Normal Topic Global Value within a variable ? (Read 527 times)
Louis Galvao
Full Member
***
Offline


"Sufferin' Succatash"

Posts: 265
Location: Canada
Joined: Feb 14th, 2005
Global Value within a variable ?
Apr 12th, 2006 at 9:15pm
Print Post Print Post  
I have finally embarked on trying to make my code more efficient.

In so doing, I have set up a Global value in Global Code as follows:

GlobalValue("Advances", "6000.00")

In my layout element programming, I have called the global value as follows:

var vNet as Double

vNet = vFebcomp - @GlobalValue("Advances")

However, testing the program indicates a type mismatch error.

Can you not utilize it in a defining a variable ?

Thanks,

Louis
  

Louis Galvao
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Global Value within a variable ?
Reply #1 - Apr 12th, 2006 at 9:26pm
Print Post Print Post  
@GlobalValue() returns a string. You need to cast it as a number before you can use it.

vNet = vFebcomp - @ToNumber(@GlobalValue("Advances"))

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Louis Galvao
Full Member
***
Offline


"Sufferin' Succatash"

Posts: 265
Location: Canada
Joined: Feb 14th, 2005
Re: Global Value within a variable ?
Reply #2 - Apr 12th, 2006 at 9:51pm
Print Post Print Post  
Ray:

Thanks.  After looking it up in the program guide, I knew it was to do with a string issue but didn't realize I had to convert to a number.

Louis
  

Louis Galvao
Back to top
 
IP Logged
 
Louis Galvao
Full Member
***
Offline


"Sufferin' Succatash"

Posts: 265
Location: Canada
Joined: Feb 14th, 2005
Re: Global Value within a variable ?
Reply #3 - Apr 19th, 2006 at 1:49pm
Print Post Print Post  
Through the use of Global Values and cleaning up my programming, so far I have been able to shave 7 seconds (or 30%) on opening one of my database forms.

Next step is create a function to further improve.

Thanks,

Louis
  

Louis Galvao
Back to top
 
IP Logged