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
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 getn dialog boxes for string input (s)

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
peter.cook Posted - 02/05/2003 : 06:48:42 AM
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

2   L A T E S T    R E P L I E S    (Newest First)
peter.cook Posted - 02/05/2003 : 10:35:12 AM
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

Mike Buess Posted - 02/05/2003 : 07:56:41 AM
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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000