Forum Post: Re: Like Input???

  • Thread starter Thread starter Simon L. Prinsloo
  • Start date Start date
Status
Not open for further replies.
S

Simon L. Prinsloo

Guest
When you display a variable, there are two memory locations associated with it, namely the variable itself and the screen buffer. To access the variable, you use its name, to access the screen buffer, you prefix the variable name with INPUT or INPUT FRAME framename. So given that the above compiles, I suspected that the parameter, variable, temp-table (or work-table) field that is defined as LIKE, could take its attributes (e.g. FORMAT and LABEL) from an instance on a frame rather than from the original definition. So I tested it with the following code, expecting to see: My Data: 123456789012 Long Data: 12345678901234567890 Interestingly enough, it does not. What is more interesting, is that it keeps compiling and working the same as before, even when you remove the definition of frame fDataFrame completely. It appears that the compile recognizes that " INPUT field " is a reference to " field " and simply ignore the "noise" caused by input, causing you to end up with legal syntax, i. e. " LIKE field", as the output is always: My Data: 123456789012 My Data: 123456789012 The test code looks like this: (Is it just me, or is OpenEdge now missing from the syntaxhighligter tool?) DEFINE VARIABLE cData AS CHARACTER FORMAT "X(12)" LABEL "My Data" NO-UNDO. DEFINE FRAME fDataFrame cData FORMAT "x(20)" LABEL "Long Data" VIEW-AS COMBO-BOX WITH SIDE-LABELS. DEFINE VARIABLE cNewData LIKE INPUT FRAME fDataFrame cData NO-UNDO. DEFINE FRAME fNewFrame cData cNewData WITH 1 COL. ASSIGN cData = "12345678901234567890" cNewData = "12345678901234567890" . DISPLAY cData cNewData WITH FRAME fNewFrame. Quite an interesting peculiarity you found here...

Continue reading...
 
Status
Not open for further replies.
Back
Top