Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old August 19th, 2003, 12:47 PM
jharber15 jharber15 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 41 jharber15 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
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.

Reply With Quote
  #2  
Old August 19th, 2003, 01:41 PM
nopoints nopoints is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Windsor ON, Canada
Posts: 459 nopoints User rank is Corporal (100 - 500 Reputation Level)nopoints User rank is Corporal (100 - 500 Reputation Level)nopoints User rank is Corporal (100 - 500 Reputation Level)nopoints User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 13 h 44 m 22 sec
Reputation Power: 8
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

Reply With Quote
  #3  
Old August 19th, 2003, 02:01 PM
jharber15 jharber15 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 41 jharber15 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
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.

Reply With Quote
  #4  
Old August 20th, 2003, 06:53 AM
Strannik Strannik is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 13 Strannik User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Why can't you do the following:

For Each fld In myrecord.Fields
Print #filenum, fld.Name & "---"
Print #filenum, "put your text here"
Next

Reply With Quote
  #5  
Old August 20th, 2003, 10:01 AM
jharber15 jharber15 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 41 jharber15 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
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.

Reply With Quote
  #6  
Old August 20th, 2003, 10:21 AM
Strannik Strannik is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 13 Strannik User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > using field name as a value


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway