File Type syntax using a string to create entry HELP 
Author Message
 File Type syntax using a string to create entry HELP

I am trying top create a file type variable using a string and I can't come
up with the correct syntax:

    Instead of :
        TTot.books = TTot.books + Val(ItemAmt)
    I am tring to do something like:
        TTot.[FilString] = TTot.[FilString] + Val(ItemAmt)

Here is my usage:

    FilString = RType(Index)
    Open TTotfile For Random Access Read Write As #1 Len = Len(TTot)

        Get #1, 1, TTot
              TTot.[FilString] = TTot.[FilString] + Val(ItemAmt)
        Put #1, 1, TTot

   Close #1

Any Thoughts?

David



Fri, 25 Jan 2002 03:00:00 GMT  
 File Type syntax using a string to create entry HELP
What does your Type statement look like?

In general, the method for Random Access files is:

Type SomeData
    SomeItem1 as Integer/Long/Single/whatever
    SomeItem2 as Integer/Long/Single/whatever
    SomeItem3 as String * <some size> 'MUST specify size
    SomeItem4 as String * <some size> 'MUST specify size
End Type

i.e. ...

Type MyRecord
   Age as Integer
   Identifier as Long
   Client as String * 40
   Email as String * 25
End Type

This creates a type record containing 2+4+40+25=71 bytes

Now DIM ...

Dim MyRec as MyRecord

And fill in the data ....

MyRec.Age = 22
MyRec.Identifier =122121
MyRec.Client = "David S. Calef"

Then just save it...

    Fno = FreeFile
    Open somefile For Random Access Read Write As #Fno Len = Len(MyRec)

    'get the next available record number
    '(assuming you want to add new records)
     totalrecords = LOF(Fno)  \ Len(MyRec)

    newRecNo = totalrecords + 1

    Get #Fno , newRecNo, MyRec
        ... OR
    Put #Fno , newRecNo, MyRec

   Close #Fno

To just retrieve, update and save a given record number ...

    RecNoToUpdate = 1

    Fno = FreeFile
    Open somefile For Random Access Read Write As #Fno Len = Len(MyRec)

    'make sure that there is something to GET
     totalrecords = LOF(Fno)  \ Len(MyRec)

     'nothing to GET if there are no records ...
     If totalrecords > 0 then
          Get #Fno , RecNoToUpdate , MyRec
     End If

      'assume Record 1 existed, and retrieved record had data:
         ' MyRec.Age = 22
         ' MyRec.Identifier =122121
         ' MyRec.Client = "David S. Calef"

     'modify data
       MyRec.Age = 23
       MyRec.Identifier =1221665
       MyRec.Client = "David G. Calef"

      'and save it back

    Put #Fno , RecNoToUpdate, MyRec

   Close #Fno

--

Randy Birch, MVP Visual Basic

http://www.mvps.org/vbnet/
http://www.mvps.org/ccrp/

Please correspond only using the newsgroups so all can benefit.



| I am trying top create a file type variable using a string and I can't
come
| up with the correct syntax:
|
|     Instead of :
|         TTot.books = TTot.books + Val(ItemAmt)
|     I am tring to do something like:
|         TTot.[FilString] = TTot.[FilString] + Val(ItemAmt)
|
| Here is my usage:
|
|     FilString = RType(Index)
|     Open TTotfile For Random Access Read Write As #1 Len = Len(TTot)
|
|         Get #1, 1, TTot
|               TTot.[FilString] = TTot.[FilString] + Val(ItemAmt)
|         Put #1, 1, TTot
|
|    Close #1
|
|
| Any Thoughts?
|
|
| David
|
|



Fri, 25 Jan 2002 03:00:00 GMT  
 File Type syntax using a string to create entry HELP
Hi Randy.....

Yup, understand all that and use Random Access File Types all the time. I
often use only the first record with lots of fields as I think this is a
fast, easy way to use files

To try to explain better:

I have created:

Type SomeData
    A as Double
    B as Double
  ..............through all 26
    Y as Double
    Z as Double
End Type

Dim MyRec as SomeData

and in the program I have 25 buttons in a command array that all have
assignments of labels, prices, and types.
So, I need to keep a running total of each Type ( ie A, B, C, through Y, Z)

Is use the MyRec file.

And use MyRec.A  MyRec.B, etc.

When each key in the command array (cmdKey(1-25)) is pressed is comes up
with a Type from the array (1-25) that matches the A-Z

I don't want to, but am using:
    Get #Fno, 1, MyRec
         If Type(Index) = A then
                MyRec.A = MyRec.A + ItemAmount
        elseif  Type(Index) = B then
                MyRec.B = MyRec.B + ItemAmount
        ........................through all 26
        elseif Type(Index) = Z then
                MyRec.Z = MyRec.Z + ItemAmount
        End If
     Put #Fno, 1, MyRec

What I want to be able to do is substitute all 26 "If....Elseif" constructs
with something like:
    TypeString = Type(Index)
    Get #Fno, 1, MyRec
         MyRec.{TypeString} = MyRec.{TypeString} + ItemAmount
     Put #Fno, 1, MyRec

 This seems like a much faster, better construct then the 26
"If.....Elseif..."  statements..

My problem is, how do I do it, with braces, brackets, parens, or
what........

Is that a clearer explanation, I hope????

To quote a great line I learned as a broadcast journalist:
""I know you think you understood what I said........., but what you fail to
realize is........., what I said is not what I meant...."

Thanks, Randy!

David


Quote:
> What does your Type statement look like?

> In general, the method for Random Access files is:

> Type SomeData
>     SomeItem1 as Integer/Long/Single/whatever
>     SomeItem2 as Integer/Long/Single/whatever
>     SomeItem3 as String * <some size> 'MUST specify size
>     SomeItem4 as String * <some size> 'MUST specify size
> End Type

> i.e. ...

> Type MyRecord
>    Age as Integer
>    Identifier as Long
>    Client as String * 40
>    Email as String * 25
> End Type

> This creates a type record containing 2+4+40+25=71 bytes

> Now DIM ...

> Dim MyRec as MyRecord

> And fill in the data ....

> MyRec.Age = 22
> MyRec.Identifier =122121
> MyRec.Client = "David S. Calef"

> Then just save it...

>     Fno = FreeFile
>     Open somefile For Random Access Read Write As #Fno Len = Len(MyRec)

>     'get the next available record number
>     '(assuming you want to add new records)
>      totalrecords = LOF(Fno)  \ Len(MyRec)

>     newRecNo = totalrecords + 1

>     Get #Fno , newRecNo, MyRec
>         ... OR
>     Put #Fno , newRecNo, MyRec

>    Close #Fno

> To just retrieve, update and save a given record number ...

>     RecNoToUpdate = 1

>     Fno = FreeFile
>     Open somefile For Random Access Read Write As #Fno Len = Len(MyRec)

>     'make sure that there is something to GET
>      totalrecords = LOF(Fno)  \ Len(MyRec)

>      'nothing to GET if there are no records ...
>      If totalrecords > 0 then
>           Get #Fno , RecNoToUpdate , MyRec
>      End If

>       'assume Record 1 existed, and retrieved record had data:
>          ' MyRec.Age = 22
>          ' MyRec.Identifier =122121
>          ' MyRec.Client = "David S. Calef"

>      'modify data
>        MyRec.Age = 23
>        MyRec.Identifier =1221665
>        MyRec.Client = "David G. Calef"

>       'and save it back

>     Put #Fno , RecNoToUpdate, MyRec

>    Close #Fno

> --

> Randy Birch, MVP Visual Basic

> http://www.mvps.org/vbnet/
> http://www.mvps.org/ccrp/

> Please correspond only using the newsgroups so all can benefit.



> | I am trying top create a file type variable using a string and I can't
> come
> | up with the correct syntax:
> |
> |     Instead of :
> |         TTot.books = TTot.books + Val(ItemAmt)
> |     I am tring to do something like:
> |         TTot.[FilString] = TTot.[FilString] + Val(ItemAmt)
> |
> | Here is my usage:
> |
> |     FilString = RType(Index)
> |     Open TTotfile For Random Access Read Write As #1 Len = Len(TTot)
> |
> |         Get #1, 1, TTot
> |               TTot.[FilString] = TTot.[FilString] + Val(ItemAmt)
> |         Put #1, 1, TTot
> |
> |    Close #1
> |
> |
> | Any Thoughts?
> |
> |
> | David
> |
> |



Fri, 25 Jan 2002 03:00:00 GMT  
 File Type syntax using a string to create entry HELP
Does this help?

 Type SomeData
        AMT(0 to 25) as Double
 End Type



Sat, 26 Jan 2002 03:00:00 GMT  
 File Type syntax using a string to create entry HELP
Hi Jeff:

Well at least you are closer.....

Not in the file type defination but rather in the "Open File, Get, change
the data, Put"  usage area.

Instead of: "MyRec.A = MyRec.A + ItemAmount"

I want to do something like  "MyRec.{TypeString} = MyRec.{TypeString} +
ItemAmount"

In other words, Instead of:
     Get #Fno, 1, MyRec
         If Type(Index) = A then
                MyRec.A = MyRec.A + ItemAmount
        elseif  Type(Index) = B then
                MyRec.B = MyRec.B + ItemAmount
        ........................through all 26
        elseif Type(Index) = Z then
                MyRec.Z = MyRec.Z + ItemAmount
        End If
     Put #Fno, 1, MyRec

I would rather substitute all 26 "If....Elseif" constructs with something
like:
    TypeString = Type(Index)
    Get #Fno, 1, MyRec
         MyRec.{TypeString} = MyRec.{TypeString} + ItemAmount
     Put #Fno, 1, MyRec

I have tried braces, brackets, parens around the TypeString and all fail.

I am sure it can be done, but I can't come up with it.........

Thanks, Jeff

David


Quote:
> Does this help?

>  Type SomeData
> AMT(0 to 25) as Double
>  End Type



Sat, 26 Jan 2002 03:00:00 GMT  
 File Type syntax using a string to create entry HELP
About the only way that I can think (offhand) of doing what you ask is to
dump the individual A/B/C doubles for an array "i.e. AtoZ(0 to 25) As
Double, then use your corresponding array of labels/text boxes/command
buttons etc.  Then, when a button or key is pressed, you know the index, and
since this corresponds directly to the indices in the labels and the AtoZ
type, you can use a single statement to add the items ...

Type SomeData
    AtoZ(0 to 25) as Double
 End Type

Dim MyRec As SomeData

    currIndex = <button>Index

    MyRec.AtoZ(currIndex) = MyRec.AtoZ(currIndex) + ItemAmount

    Put#FinleNum, MyRec

Any help?

--

Randy Birch, MVP Visual Basic

http://www.mvps.org/vbnet/
http://www.mvps.org/ccrp/

Please correspond only using the newsgroups so all can benefit.



| Hi Randy.....
|
| Yup, understand all that and use Random Access File Types all the time. I
| often use only the first record with lots of fields as I think this is a
| fast, easy way to use files
|
| To try to explain better:
|
| I have created:
|
| Type SomeData
|     A as Double
|     B as Double
|   ..............through all 26
|     Y as Double
|     Z as Double
| End Type
|
| Dim MyRec as SomeData
|
| and in the program I have 25 buttons in a command array that all have
| assignments of labels, prices, and types.
| So, I need to keep a running total of each Type ( ie A, B, C, through Y,
Z)
|
| Is use the MyRec file.
|
| And use MyRec.A  MyRec.B, etc.
|
| When each key in the command array (cmdKey(1-25)) is pressed is comes up
| with a Type from the array (1-25) that matches the A-Z
|
| I don't want to, but am using:
|     Get #Fno, 1, MyRec
|          If Type(Index) = A then
|                 MyRec.A = MyRec.A + ItemAmount
|         elseif  Type(Index) = B then
|                 MyRec.B = MyRec.B + ItemAmount
|         ........................through all 26
|         elseif Type(Index) = Z then
|                 MyRec.Z = MyRec.Z + ItemAmount
|         End If
|      Put #Fno, 1, MyRec
|
| What I want to be able to do is substitute all 26 "If....Elseif"
constructs
| with something like:
|     TypeString = Type(Index)
|     Get #Fno, 1, MyRec
|          MyRec.{TypeString} = MyRec.{TypeString} + ItemAmount
|      Put #Fno, 1, MyRec
|
|  This seems like a much faster, better construct then the 26
| "If.....Elseif..."  statements..
|
| My problem is, how do I do it, with braces, brackets, parens, or
| what........
|
| Is that a clearer explanation, I hope????
|
| To quote a great line I learned as a broadcast journalist:
| ""I know you think you understood what I said........., but what you fail
to
| realize is........., what I said is not what I meant...."
|
| Thanks, Randy!
|
| David
|
|
|


| > What does your Type statement look like?
| >
| > In general, the method for Random Access files is:
| >
| > Type SomeData
| >     SomeItem1 as Integer/Long/Single/whatever
| >     SomeItem2 as Integer/Long/Single/whatever
| >     SomeItem3 as String * <some size> 'MUST specify size
| >     SomeItem4 as String * <some size> 'MUST specify size
| > End Type
| >
| > i.e. ...
| >
| > Type MyRecord
| >    Age as Integer
| >    Identifier as Long
| >    Client as String * 40
| >    Email as String * 25
| > End Type
| >
| > This creates a type record containing 2+4+40+25=71 bytes
| >
| > Now DIM ...
| >
| > Dim MyRec as MyRecord
| >
| > And fill in the data ....
| >
| > MyRec.Age = 22
| > MyRec.Identifier =122121
| > MyRec.Client = "David S. Calef"

| >
| > Then just save it...
| >
| >     Fno = FreeFile
| >     Open somefile For Random Access Read Write As #Fno Len = Len(MyRec)
| >
| >     'get the next available record number
| >     '(assuming you want to add new records)
| >      totalrecords = LOF(Fno)  \ Len(MyRec)
| >
| >     newRecNo = totalrecords + 1
| >
| >     Get #Fno , newRecNo, MyRec
| >         ... OR
| >     Put #Fno , newRecNo, MyRec
| >
| >    Close #Fno
| >
| >
| > To just retrieve, update and save a given record number ...
| >
| >     RecNoToUpdate = 1
| >
| >     Fno = FreeFile
| >     Open somefile For Random Access Read Write As #Fno Len = Len(MyRec)
| >
| >     'make sure that there is something to GET
| >      totalrecords = LOF(Fno)  \ Len(MyRec)
| >
| >      'nothing to GET if there are no records ...
| >      If totalrecords > 0 then
| >           Get #Fno , RecNoToUpdate , MyRec
| >      End If
| >
| >       'assume Record 1 existed, and retrieved record had data:
| >          ' MyRec.Age = 22
| >          ' MyRec.Identifier =122121
| >          ' MyRec.Client = "David S. Calef"

| >
| >
| >      'modify data
| >        MyRec.Age = 23
| >        MyRec.Identifier =1221665
| >        MyRec.Client = "David G. Calef"

| >
| >       'and save it back
| >
| >     Put #Fno , RecNoToUpdate, MyRec
| >
| >    Close #Fno
| >
| > --
| >
| > Randy Birch, MVP Visual Basic
| >
| > http://www.mvps.org/vbnet/
| > http://www.mvps.org/ccrp/

| >
| > Please correspond only using the newsgroups so all can benefit.
| >
| >


| > | I am trying top create a file type variable using a string and I can't
| > come
| > | up with the correct syntax:
| > |
| > |     Instead of :
| > |         TTot.books = TTot.books + Val(ItemAmt)
| > |     I am tring to do something like:
| > |         TTot.[FilString] = TTot.[FilString] + Val(ItemAmt)
| > |
| > | Here is my usage:
| > |
| > |     FilString = RType(Index)
| > |     Open TTotfile For Random Access Read Write As #1 Len = Len(TTot)
| > |
| > |         Get #1, 1, TTot
| > |               TTot.[FilString] = TTot.[FilString] + Val(ItemAmt)
| > |         Put #1, 1, TTot
| > |
| > |    Close #1
| > |
| > |
| > | Any Thoughts?
| > |
| > |
| > | David
| > |
| > |
| >
| >
|
|



Sat, 26 Jan 2002 03:00:00 GMT  
 File Type syntax using a string to create entry HELP
You can't find it 'cause it ain't there, David!  There is no such syntax
- your member names were all discarded and converted into offsets when
you compiled . . . that's how UDTs work.  You can get the offsets using
an array, and you can probably build a function that will 'back-fill' to
make the associations you want, but you're digging a dry well trying
brackets etc <g>
Quote:

> Hi Jeff:

> Well at least you are closer.....

> Not in the file type defination but rather in the "Open File, Get, change
> the data, Put"  usage area.

> Instead of: "MyRec.A = MyRec.A + ItemAmount"

> I want to do something like  "MyRec.{TypeString} = MyRec.{TypeString} +
> ItemAmount"

> In other words, Instead of:
>      Get #Fno, 1, MyRec
>          If Type(Index) = A then
>                 MyRec.A = MyRec.A + ItemAmount
>         elseif  Type(Index) = B then
>                 MyRec.B = MyRec.B + ItemAmount
>         ........................through all 26
>         elseif Type(Index) = Z then
>                 MyRec.Z = MyRec.Z + ItemAmount
>         End If
>      Put #Fno, 1, MyRec

> I would rather substitute all 26 "If....Elseif" constructs with something
> like:
>     TypeString = Type(Index)
>     Get #Fno, 1, MyRec
>          MyRec.{TypeString} = MyRec.{TypeString} + ItemAmount
>      Put #Fno, 1, MyRec

> I have tried braces, brackets, parens around the TypeString and all fail.

> I am sure it can be done, but I can't come up with it.........

> Thanks, Jeff

> David



> > Does this help?

> >  Type SomeData
> > AMT(0 to 25) as Double
> >  End Type



Sat, 26 Jan 2002 03:00:00 GMT  
 File Type syntax using a string to create entry HELP
You have a control array of command buttons, and want to associated
them with Double values in an array.  You are using a UDT to make
file access easier and now want a method to access the members of the
UDT, using the index from the control array.

Does that about sum it up?

Perhaps you overlooked the fact that you can Get and Put an entire
array, just like your UDT.  I would suggest you use something similar
to:

Dim MyTypes(0 To 25) As Double

Then:
     'Open For BINARY  
     Get #Fno, 1, MyTypes
     MyTypes(Index) = MyTypes(Index) + ItemAmount
     Put #Fno, 1, MyTypes

Check out the help file on Get and see if it states:

"For files opened in Binary mode, all of the Random rules apply, except:

In Binary mode, the Len clause in the Open statement has no effect.
Get reads all variables from disk contiguously; that is, with no padding
between records.

For any array other than an array in a user-defined type, Get reads only
the data.  No descriptor is read."

Good Luck
LFS



Sat, 26 Jan 2002 03:00:00 GMT  
 File Type syntax using a string to create entry HELP
Randy:

I thank you, but I guess I will give up on this.

Your suggestion is very useful for a future project, but does not work here.

The Type(Index) array does not match directly to the  AtoZ(0 to 25) as
Double array in the file type.  i.e  Type(6), Type(9), Type(10) might all
return "A" and Type(1) might be Q.   It is the Type of sale item assigned by
the end user for accounting purposes, candy, newspapers, cigarettes,
aspirin, etc.  That's why I was trying to create the MyData.(TypeString)
notation rather than 26 "if....elseif" constructs.   But the "if.....elseif"
works just fine, so I will let it stand.

Thanks again for your time and input.

David


Quote:
> About the only way that I can think (offhand) of doing what you ask is to
> dump the individual A/B/C doubles for an array "i.e. AtoZ(0 to 25) As
> Double, then use your corresponding array of labels/text boxes/command
> buttons etc.  Then, when a button or key is pressed, you know the index,
and
> since this corresponds directly to the indices in the labels and the AtoZ
> type, you can use a single statement to add the items ...

> Type SomeData
>     AtoZ(0 to 25) as Double
>  End Type

> Dim MyRec As SomeData

>     currIndex = <button>Index

>     MyRec.AtoZ(currIndex) = MyRec.AtoZ(currIndex) + ItemAmount

>     Put#FinleNum, MyRec

> Any help?

> --

> Randy Birch, MVP Visual Basic

> http://www.mvps.org/vbnet/
> http://www.mvps.org/ccrp/

> Please correspond only using the newsgroups so all can benefit.



> | Hi Randy.....
> |
> | Yup, understand all that and use Random Access File Types all the time.
I
> | often use only the first record with lots of fields as I think this is a
> | fast, easy way to use files
> |
> | To try to explain better:
> |
> | I have created:
> |
> | Type SomeData
> |     A as Double
> |     B as Double
> |   ..............through all 26
> |     Y as Double
> |     Z as Double
> | End Type
> |
> | Dim MyRec as SomeData
> |
> | and in the program I have 25 buttons in a command array that all have
> | assignments of labels, prices, and types.
> | So, I need to keep a running total of each Type ( ie A, B, C, through Y,
> Z)
> |
> | Is use the MyRec file.
> |
> | And use MyRec.A  MyRec.B, etc.
> |
> | When each key in the command array (cmdKey(1-25)) is pressed is comes up
> | with a Type from the array (1-25) that matches the A-Z
> |
> | I don't want to, but am using:
> |     Get #Fno, 1, MyRec
> |          If Type(Index) = A then
> |                 MyRec.A = MyRec.A + ItemAmount
> |         elseif  Type(Index) = B then
> |                 MyRec.B = MyRec.B + ItemAmount
> |         ........................through all 26
> |         elseif Type(Index) = Z then
> |                 MyRec.Z = MyRec.Z + ItemAmount
> |         End If
> |      Put #Fno, 1, MyRec
> |
> | What I want to be able to do is substitute all 26 "If....Elseif"
> constructs
> | with something like:
> |     TypeString = Type(Index)
> |     Get #Fno, 1, MyRec
> |          MyRec.{TypeString} = MyRec.{TypeString} + ItemAmount
> |      Put #Fno, 1, MyRec
> |
> |  This seems like a much faster, better construct then the 26
> | "If.....Elseif..."  statements..
> |
> | My problem is, how do I do it, with braces, brackets, parens, or
> | what........
> |
> | Is that a clearer explanation, I hope????
> |
> | To quote a great line I learned as a broadcast journalist:
> | ""I know you think you understood what I said........., but what you
fail
> to
> | realize is........., what I said is not what I meant...."
> |
> | Thanks, Randy!
> |
> | David
> |
> |
> |


> | > What does your Type statement look like?
> | >
> | > In general, the method for Random Access files is:
> | >
> | > Type SomeData
> | >     SomeItem1 as Integer/Long/Single/whatever
> | >     SomeItem2 as Integer/Long/Single/whatever
> | >     SomeItem3 as String * <some size> 'MUST specify size
> | >     SomeItem4 as String * <some size> 'MUST specify size
> | > End Type
> | >
> | > i.e. ...
> | >
> | > Type MyRecord
> | >    Age as Integer
> | >    Identifier as Long
> | >    Client as String * 40
> | >    Email as String * 25
> | > End Type
> | >
> | > This creates a type record containing 2+4+40+25=71 bytes
> | >
> | > Now DIM ...
> | >
> | > Dim MyRec as MyRecord
> | >
> | > And fill in the data ....
> | >
> | > MyRec.Age = 22
> | > MyRec.Identifier =122121
> | > MyRec.Client = "David S. Calef"

> | >
> | > Then just save it...
> | >
> | >     Fno = FreeFile
> | >     Open somefile For Random Access Read Write As #Fno Len =
Len(MyRec)
> | >
> | >     'get the next available record number
> | >     '(assuming you want to add new records)
> | >      totalrecords = LOF(Fno)  \ Len(MyRec)
> | >
> | >     newRecNo = totalrecords + 1
> | >
> | >     Get #Fno , newRecNo, MyRec
> | >         ... OR
> | >     Put #Fno , newRecNo, MyRec
> | >
> | >    Close #Fno
> | >
> | >
> | > To just retrieve, update and save a given record number ...
> | >
> | >     RecNoToUpdate = 1
> | >
> | >     Fno = FreeFile
> | >     Open somefile For Random Access Read Write As #Fno Len =
Len(MyRec)
> | >
> | >     'make sure that there is something to GET
> | >      totalrecords = LOF(Fno)  \ Len(MyRec)
> | >
> | >      'nothing to GET if there are no records ...
> | >      If totalrecords > 0 then
> | >           Get #Fno , RecNoToUpdate , MyRec
> | >      End If
> | >
> | >       'assume Record 1 existed, and retrieved record had data:
> | >          ' MyRec.Age = 22
> | >          ' MyRec.Identifier =122121
> | >          ' MyRec.Client = "David S. Calef"

> | >
> | >
> | >      'modify data
> | >        MyRec.Age = 23
> | >        MyRec.Identifier =1221665
> | >        MyRec.Client = "David G. Calef"

> | >
> | >       'and save it back
> | >
> | >     Put #Fno , RecNoToUpdate, MyRec
> | >
> | >    Close #Fno
> | >
> | > --
> | >
> | > Randy Birch, MVP Visual Basic
> | >
> | > http://www.mvps.org/vbnet/
> | > http://www.mvps.org/ccrp/

> | >
> | > Please correspond only using the newsgroups so all can benefit.
> | >
> | >


> | > | I am trying top create a file type variable using a string and I
can't
> | > come
> | > | up with the correct syntax:
> | > |
> | > |     Instead of :
> | > |         TTot.books = TTot.books + Val(ItemAmt)
> | > |     I am tring to do something like:
> | > |         TTot.[FilString] = TTot.[FilString] + Val(ItemAmt)
> | > |
> | > | Here is my usage:
> | > |
> | > |     FilString = RType(Index)
> | > |     Open TTotfile For Random Access Read Write As #1 Len = Len(TTot)
> | > |
> | > |         Get #1, 1, TTot
> | > |               TTot.[FilString] = TTot.[FilString] + Val(ItemAmt)
> | > |         Put #1, 1, TTot
> | > |
> | > |    Close #1
> | > |
> | > |
> | > | Any Thoughts?
> | > |
> | > |
> | > | David
> | > |
> | > |
> | >
> | >
> |
> |



Sat, 26 Jan 2002 03:00:00 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. create a file type for a virtual directory in IIS using a command line script

2. HELP : Using a string to create a reference to Form Controls

3. Writing an empty string using RegSetKeyValueEx on NT corrupts registry entry

4. Newbie - Question with ASP Syntax using Request.Form in string

5. Using types in a different assembly given that the type may be used or not used

6. Need help creating file type associations

7. string syntax to get data in file

8. Using 's in SQL syntax creates error

9. How to create new DUN phonebook entry w/o using dialogs

10. Need help with connection string syntax - Smartware via ODBC

11. HELP - Database string with apostrophe causes Syntax Error in Query Expression

12. Cretaing Windows Help File, Syntax RTF-File

 

 
Powered by phpBB® Forum Software