Posted By: Yashas
A Big Mess with "pan_setdigits" - 11/27/12 12:49
When I supply a non-pointer variable to pan_setdigits ,it does not work.
So does pan_setdigits last parameter requires a pointer only??
If so,
I need a solution for tis!!
I have a struct UserProfile (Many might kno ,I had posted tis several times).
All of the elements in the stuct are non-pointers.
How do I make it work under pan_setdigits??
Posted By: Ch40zzC0d3r
Re: A Big Mess with "pan_setdigits" - 11/27/12 12:53
pan_setdigits(PANEL*, var num, var x, var y, STRING* format, FONT* font, var factor, var* pv)
Did you realize the var *pv?
It only takes a POINTER.
Posted By: WretchedSid
Re: A Big Mess with "pan_setdigits" - 11/27/12 14:10
Lite-C usually references variables if required. If it doesn't work, just the reference operator &.
Posted By: Yashas
Re: A Big Mess with "pan_setdigits" - 11/27/12 16:40
The prob is I use ActiveProfile.VARIABLE as an argument to pan_setdigits.My ActiveProfile stucture elements are all non-pointers.
If I make a all pointers I wud hav to change almost 2k lines and in edtition some pointers stuff again.
I just came up here to ask if there was any other solution??
Posted By: Uhrwerk
Re: A Big Mess with "pan_setdigits" - 11/27/12 16:47
It does not matter if they are pointers or not in the first place. The & operator will return the variables address.
Posted By: Yashas
Re: A Big Mess with "pan_setdigits" - 11/29/12 16:50
I gave "&ActiveProfile.VARIABLE" as the parameter ,I get "Syntax Error"
and I also tried "ActiveProfile.&VARIABLE" ,I get "ActiveProfile is not a keyword" or something.
??
Or cud you give me an example using the address of operator??
THanks
Posted By: Uhrwerk
Re: A Big Mess with "pan_setdigits" - 11/29/12 18:08
You have to to pay attention to operator precedence!
&(ActiveProfile.VARIABLE)
Posted By: Yashas
Re: A Big Mess with "pan_setdigits" - 11/30/12 11:44
digits(320,40,4,DialogSubText,1,&(ActiveProfile.BPI));
It did not work ;I get an error "Syntax Error: & Invalid Character &"
Posted By: Kartoffel
Re: A Big Mess with "pan_setdigits" - 11/30/12 13:36
the parameters you're giving are wrong:
digits(x, y, format, font, factor, var);
pan_setdigits(PANEL*, var num, var x, var y, STRING* format, FONT* font, var factor, var* pv);
Posted By: Yashas
Re: A Big Mess with "pan_setdigits" - 11/30/12 16:51
ops, sorry!! Frgt that digits can work with non-pointers