The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 getn dialog boxes for string input (s)
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

peter.cook

UK
356 Posts

Posted - 02/05/2003 :  06:48:42 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi,

Can anyone help/clarify?

I'm trying to input 3 strings via a dialog using getn and have either come across a quirk/minor bug or don't exactly understand what's going on...

The code I would expect to work is:

Create CompoundID -s 3;
%T=""; %U=""; %V="";
Getn (Compound ID 1) %%T (Compound ID 2) %%U (Compound ID 3) %%V (Enter Compound IDs);

// Use variables
CompoundID[1]$="%T";
CompoundID[2]$="%U";
CompoundID[3]$="%V";
%Z="%T";
If(%U!=""&&%U!=" ") %Z="%Z %U";
If(%V!=""&&%V!=" ") %Z="%Z %V";
SRDataPlot!compoundid.text$=" %Z"; // Keep text is not "";

This however displays " T", " U" & " V" in the dialog box.
If I don't later the values & click OK then %T,%U,%V = "".

Create CompoundID -s 3;
%T=" "; %U=" "; %V=" ";
Getn (Compound ID 1) %%T (Compound ID 2) %%U (Compound ID 3) %%V (Enter Compound IDs); seems to work OK and keeps the space but I would then have to do something like if(%T==" ") %T="";

%T=""; %U=""; %V="";
Getn (Compound ID 1) %T (Compound ID 2) %U (Compound ID 3) %V (Enter Compound IDs); displays only entries for 1st and second dialog (but no space as expected) - I then can't read these values eg %T="...".

Cheers,

Pete

Mike Buess

USA
3037 Posts

Posted - 02/05/2003 :  07:56:41 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Pete,

I agree that getn handles empty string variables awkwardly and have found that it's most reliable to start with a default value...

%T="001"; %U="002"; %V="003";
Getn (Compound ID 1) %%T (Compound ID 2) %%U (Compound ID 3) %%V (Enter Compound IDs);

That way (1) you know what will show up in the dialog and (2) the return value can be used as it was entered.

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 02/05/2003 08:09:33 AM
Go to Top of Page

peter.cook

UK
356 Posts

Posted - 02/05/2003 :  10:35:12 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Mike,

That does seem to be the case, in which case (Originlab) I'd call it a minor bug.. I agree default values makes it more reliable but not ideal for the user in some cases..

Thanks for reply,

Cheers,

Pete

Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000