pgrootenhuis
31st July 2003, 14:03
I'm trying to get the current company number into a variable, but don't succeed. I know it's fairly simple (something with get.compnr() ), but can anyone help me out here ? I also need to decalre the variable in witch I put the company number, can I do that as a string or do I have to do that as a long ?
I want to export the variable in an ascii-file, so I don't need to use a oncase loop.
Greetz,
Peter.
:cool:
zardoz
31st July 2003, 14:59
Try this:
domain tcncnp comp.no
comp.no = compnr
| tcncnp is a integer, if you want to put in a ascii file:
string comp.str(3)
comp.str = edit$(compnr, "999")
NvanBeest
1st August 2003, 09:51
Hi Peter
Zardos is completely right. The only thing he did not answer was the use of get.compnr() ;) This function returns a long, thus you don't really need any domain to store it. The following will do the trick:
long comp
comp = get.compnr()
And then you can still use the edit$() to convert it!
pgrootenhuis
1st August 2003, 11:17
Thanks guys!
I've taken the solution from Nico (sorry Zardoz:( ), it works (like expected...) fine.
Regards,
Peter.
zardoz
1st August 2003, 12:12
compnr is a system variable that has the same result as get.compnr() function.
So both solutions are completely equivalent.
I think that getting a value from a variable is a little (ok, very very little ;) ) better as performance than calling a function.
pgrootenhuis
1st August 2003, 12:42
You're right, that also works. For now I cannot determine which option is best for my preformance, because I'm using very small files (read: tables) now. Perhaps later I'll notice differences when the files are bigger.
Peter.:D