On Click and other GUI element statuses


#1

So, I only want to save information when a confirm button is pressed (write the data to a string). Also, I don’t know how to make arrays of strings. Do I have to make it a table? I just made a table for my “array”. Usually I’d have a command in C, for instance, when a button is clicked, whatever I wanted would process, “OnClick”. Is there a way to do this? Same thing with a button pressed down time, GUI stuff like that.
Thanks.


#2

Hello FlyingTurtle! (BTW, wondering why “Flying Turtle”? I hope you’ll share!)

First of all, yes, a table is what you’d use for an Array.

Those “events” like “OnClick” you might have used in other programming environments, don’t really have an equivalent in PAC Display and/or groov. You pretty much write or read values. I’m guessing here you’ll want to do something like: write a 1 to a variable perhaps called nWriteTableFlag or some such. Then, in your strategy logic, you could see if nWriteTableFlag is 1, if so, set it back to 0 (before you forget) then do the “write data to string,” whatever that means to you. Then you’d loop back around to check that flag (after a short/reasonable delay, of course).

What do you mean by “write the data to a string”? Perhaps copying values from something you’re showing in the GUI to something that’s being logged elsewhere? (Can you tell us the “bigger picture” here?)

BTW, check out this post about using and initializing tables.
I also wrote this “Tables 101” post, but that’s mostly for those who’ve never done any programming before, and it sounds like you have, so it might be a bit basic for your skill level.

In any case, I hope you’ll share more about your application (and username!).

Cheers,
Mary


#3

Kind of a late response…but, my user name originates from a character in a cartoon/anime called Love Hina. She/he is a flying turtle, and I thought that was cute, so I have been using this SN for things like games, and just continue to use it as a forum name so that I can remember it.
My application is basically a program that checks the status of pressure in containers and controls when to start/stop filling with pressure, in a nut shell.