Post new topic Reply to topic  [ 3 posts ] 

Board index : TeleFlow Forums : TeleFlow Designer & Simulator

Author Message
 Post subject:
PostPosted: Fri Jan 16, 2004 12:52 pm 
Offline

Joined: Fri Jan 16, 2004 12:00 pm
Posts: 37
Location: Juarez
I'm trying to compare a variable (from a visual fox pro database @VARIABLE) with a variable entered by the user (@MYVARIABLE). <br>User enters 7 digits, so Teleflow sets this @MYVARIABLE as integer. <br>The database @VARIABLE is declared on the database as string(9) even when its contents are just 7 digits, so @VARIABLE equals the 7 digits plus 2 blank spaces. <br>Whe I try to campare @MYVARIABLE vs @VARIABLE its never true because one is integer:"1234567" and the other is string:"1234567 " (note the 2 blank spaces). <br>What I'm doing now is to substract the first seven possitions out from @VARIABLE, and then compare it. This way works but... <br>My question is: Is it possible to convert the string variable (@VARIABLE) to integer?


Back to top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 16, 2004 1:16 pm 
Offline

Joined: Wed Mar 19, 2003 4:28 pm
Posts: 510
Location: Canada
Although you can't quite "convert the string to an integer", there are some easy things you can do to accomplish the same thing, particularly since spaces are the problem. <br> <br>The first suggestion I would make is to see if the ODBC drivers you are using support any functions like "TRIM", which will remove spaces from the field when they are returned to your variable. Then you could easily compare the two 'space free' variables as integers. (Unless you have a good ODBC driver for VFP, you will probably find it has very limited functionality, and that what it does have works very poorly.) <br> <br>So, failing that, there is a Template flowchart that ships with TeleFlow Designer that will do the same. Go to the TAP screen of your application. In the Steps Toolbox there is a "Templates" tab. Click on the "RightTrim" flowchart, and drop it into your application. Whenever you retrieve a character/string variable from the database, pass that variable into the "RightTrim" flowchart (in its first parameter). The variable will be updated to contain the same value it had before, without the trailing spaces.


Back to top
 Profile WWW 
 
 Post subject:
PostPosted: Fri Jan 16, 2004 1:41 pm 
Offline

Joined: Fri Jan 16, 2004 12:00 pm
Posts: 37
Location: Juarez
Ok... Thank you very much


Back to top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

Board index : TeleFlow Forums : TeleFlow Designer & Simulator


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Style by Midnight Phoenix & N.Design Studio
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.