that makes sense now, thanks tanner!
Yay, glad I could help! Very Happy
could you help me with some example code?
Sure. I assume you mean the code to scan through your elements for data? Here is how I would do it:
MoveToNextValue: (A is pointer to current location in string, Str1 is the string you used with the renderer)
Code:
Instring(Str1,"<PlotScreenPlus>",A)+1
if Ans != 1
Ans->A
To read the current value pointed to by A (from the above routine)
Code:
Instring(Str1,"<PlotScreenPlus>",A
If Ans != 0
Then
Sub(Str1,A,Ans-A
Else
"
End
You would then cycle through all of your elements to find the correct one using the first routine, and read the value using the second routine. For instance, if we had this GUI:
Code:
Sum(9
Sum(7,1,"0000000000","Test GUI"
Sum(7,4,0,0,0,"Test Text
Sum(7,10,0,20,2,1,"Button 1
Sum(7,10,0,26,2,0,"Button 2
Sum(7,10,0,32,2,0,"Button 3
Sum(12,0,0,1

1->A
For(B,0,1)
Instring(Str1,"<PlotScreenPlus>",A)+1
if Ans != 1
Ans->A
End
Instring(Str1,"<PlotScreenPlus>",A
If Ans != 0
Then
Sub(Str1,A,Ans-A
Else
"
End
if expr(Ans
1->C
Instring(Str1,"<PlotScreenPlus>",A)+1
if Ans != 1
Ans->A
Instring(Str1,"<PlotScreenPlus>",A
If Ans != 0
Then
Sub(Str1,A,Ans-A
Else
"
End
if expr(Ans
2->C
Instring(Str1,"<PlotScreenPlus>",A)+1
if Ans != 1
Ans->A
Instring(Str1,"<PlotScreenPlus>",A
If Ans != 0
Then
Sub(Str1,A,Ans-A
Else
"
End
if expr(Ans
3->C

Disp "You picked button
Disp C

(Bad code, sorry)
That makes sense to me! That last paragraph of SirTanner's (_player's) post is what has the bit you're specifically asking about.
what does string for the renderer?
calcman wrote:
what does string for the renderer?
Wow, that made no sense whatsoever. Please try to complete full sentences with spelling and grammar; it makes life easier for everyone. Smile
I think he forgot the word "mean".

It is the last argument you pass to Sum(12
is that where the button detection is registered to?
Yes, it is Smile Do you understand why we have to scroll through the string the way I showed?
calcman wrote:
is that where the button detection is registered to?
It's where a bunch of stuff gets stored. The text typed into boxes, the radio buttons selected, etc. However, the index of the item that was clicked is returned in Ans, not that string.
but the cursor coordinates are into ans... ex. {47,32,1
They are. The string isn't returned in Ans, it is returned in StrX, where X is the string you supply to Sum(12,0,0,X) For instance, 1 is Str1, 5 is Str5, 10 is Str0, and the rest are hacked strings that you can only get to with xLib (Which can be done because xLib is in DCS)
_player1537 wrote:
They are. The string isn't returned in Ans, it is returned in StrX, where X is the string you supply to Sum(12,0,0,X) For instance, 1 is Str1, 5 is Str5, 10 is Str0, and the rest are hacked strings that you can only get to with xLib (Which can be done because xLib is in DCS)
The list in Ans is {X,Y,clicked,trigger} (check out http://dcs.cemetech.net/index.php?title=BasicLibs:GUIMouse ). First two elements are {X,Y} where the click happened. Third item says if it was a left- or right-click. The fourth and final element says which item was clicked that caused the GUIMouse to end. The data in items like radio buttons, text input boxes, checkboxes, integer input boxes, etc. gets stored in the string named in the sum(12,...) arguments, though.
so...
sum(7,10,x,y,a,b,str2
sum(12,a,b,str1
then the str1 contains the registered button push?
Nope, it has to be a number. And the Sum(7 statement is also incorrect.

That would really be: Sum(7,10,x,y,a,b,"Hello" // Could be a string variable, but I am not using that because it might be confusing.
Sum(12,c,d,1

After that, yes, Str1 has the right button values.
More like:


Code:
sum(9
sum(7,1,"0000000000","Test GUI"
sum(7,4,0,0,0,"Test Text
sum(7,10,0,20,2,1,"Button 1
sum(7,10,0,26,2,0,"Button 2
sum(7,10,0,32,2,0,"Button 3
sum(12,0,0,1->Ans


Ans(4) would have the index of the item clicked. Str1 would contain the value of each of the radio buttons, I think as 1+0+0 or thereabouts.
so you omit str and have numeric value for number strN

also is the string (ans) stored as a list?
Correct. Is this making sense to you?

Edit:
KermMartian wrote:
More like:


Code:
sum(9
sum(7,1,"0000000000","Test GUI"
sum(7,4,0,0,0,"Test Text
sum(7,10,0,20,2,1,"Button 1
sum(7,10,0,26,2,0,"Button 2
sum(7,10,0,32,2,0,"Button 3
sum(12,0,0,1->Ans


Ans(4) would have the index of the item clicked. Str1 would contain the value of each of the radio buttons, I think as 1+0+0 or thereabouts.

I am too lazy to actually make my own post so instead I quote people and then don't say anything new

Edit 2: Ans is different from the string Sum(12 stores to. Ans has to do with what caused the GUI to end, the string has to do with what data was stored in the GUI before it ended.
question: if ans= {1,0,0,1

the first (topmost button) would =1 and 2nd =0
............?
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
» Goto page Previous  1, 2, 3 ... 9, 10, 11, 12  Next
» View previous topic :: View next topic  
Page 10 of 12
» All times are UTC - 5 Hours
 
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 vote in polls in this forum

 

Advertisement