|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
using field name as a value
I want to be able to put IF statements in my codes, that say
"If field name 1, then:" I want to do this while I am looping through all the fields with For Each fld In myrecord.Fields Print #filenum, fld.Value; Next Of course, I'd want it to be before the Next command. my goal is to print characters when things equal a certain field of the table. Thanks guys, Let me know. |
|
#2
|
|||
|
|||
|
i don't follow what you are trying to do. could you explain more?
you can do: Code:
If fld.Name = "SomeField" Then
' stuff
End If
__________________
Programmer's Corner |
|
#3
|
|||
|
|||
|
I am trying to print some text to file while printing the fields to file. For example, field1, field2, and field3 are my fields. I want to print
Field1 ----^^^text here^^^----Field2----^^^Text here^^^----Field3. |
|
#4
|
|||
|
|||
|
Why can't you do the following:
For Each fld In myrecord.Fields Print #filenum, fld.Name & "---" Print #filenum, "put your text here" Next |
|
#5
|
|||
|
|||
|
Sorry,
I was just using that as a generalized view of what I'm doing. The text betweem each of these fields will be different, but consistant through records. There will not be the same text between the first and second field, as there is between the 5th and 6th. |
|
#6
|
|||
|
|||
|
But you may use select/case statement:
For Each fld In myrecord.Fields Print #filenum, fld.Name & "---" select fld.Name Case "MyMoney" Print #filenum, "my money" case "UncleMoney" Print #filenum, "my future money" end select Next |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > using field name as a value |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|