Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / checking a function reads true

Author
Message
yr un olaf
18
Years of Service
User Offline
Joined: 28th May 2006
Location:
Posted: 2nd Jun 2006 12:05
i was just wondering if there is a way of checking if a function is true or false ie

do
if nbr <20 then
check()
if check is true then
nbr = 1

something like that if you know what i mean

thanks
D Ogre
20
Years of Service
User Offline
Joined: 19th Nov 2003
Location:
Posted: 2nd Jun 2006 23:20
If the function does not use global variables or arrays, you will have to set the function up to return the values to be checked to the main program code.

To do this you will have to place the value you want to return from the function at the end of either the EXITFUNCTION or the ENDFUNCTION commands.

Note: You can only pass one value at a time with either of these commands.

Example code:
do

if nbr < 20
if check()=1 then nbr = 1
endif

loop

function check()

` Function code goes here.

` The statement below can be used to force the function to exit
` permaturely if the condition was met for it. The condition
` will be up to you to determine for an early exit.

if variable a > variable b then exitfunction 0

endfunction 1

The 0 and 1 values are used as a toggle flag. One equal yes(on), and zero equals no(off). The values can really be anything just as long as you know what they are in order to check for them.
CuCuMBeR
21
Years of Service
User Offline
Joined: 11th Jan 2003
Location: Turkey
Posted: 3rd Jun 2006 21:01

Login to post a reply

Server time is: 2024-09-25 01:22:17
Your offset time is: 2024-09-25 01:22:17