Data Declared in Embed Cannot be Selected in Window Designer

I have defined data in a procedure in two ways. One was simply through the IDE Data tab for my procedure and the other way was through an EMBED just before the procedure data (Start of “Declaration Section”). See clip of source. The data declarations are adjacent to each other in the source file, no code in between.

image
Here’s the problem … The data field LOC:Day1_0900 will display in the Window for my procedure. The data field (or any of the fields in that EMBED section) Day7_0400 will NOT display.

Any ideas why? I could muscle through it by adding each of the 112 fields in using the IDE, but that just seems … unnecessary.

thanks

Mark

The window designer doesn’t know about data that you’ve declared manually.
But you’ve already discovered that :wink:

No idea about C8.
With C11 you can click the down arrow shown, select Simple, and then manually create data stuff to your heart’s content (rather than one-at-a-time with the Insert/Edit variable screen).

And 97.38% of the time it actually works, saves the variables, doesn’t crash.

editDataDeclarations

1 Like

I see no problem with it. In your favorite text editor (like Notepad) just create all variable you need in simple format

loc:var1 string(20)
loc:var2 string(20)
loc:var3 string(20)
etc..

then simply COPY it, select the Local Variable section in IDE Data tab, and Paste it! it will automatically create all you need!

3 Likes

I’ll rephrase what @Clarion_clarion was trying to tell you how to easily add IDE data fields using your existing declarations:

  1. In the Embeditor Data Embed Select your lines with Day7_0330 STRING(20) thru Day7_0430 STRING(20)
  2. Then COPY to clipboard i.e. Ctrl + C
  3. Click Data Pad “Local Data”, then click on a field e.g. Loc:DayState DATE
  4. Press Ctrl+V to Paste
  5. Your data will appear in the Data Pad below the variable in step 3
  6. Back in the Data Embed delete your code, or I usually comment it out until I’m sure I have it all working

Not every hand code feature transfers so check the generated code. E.g. sometimes default value does not. Often the !Comment does not end up in Description

Thank you all for the replies. Copying and pasting into the Data section in the IDE worked like a charm!!! Wish I knew that a while ago.

I still don’t understand why the IDE embed point wouldn’t work. There is no visible code betweeen the two embed sections … another mystery that I guess doesn’t need solving.

I still don’t understand why the IDE embed point wouldn’t work. There is no visible code betweeen the two embed sections … another mystery that I guess doesn’t need solving.

When you create something in the data pad it gets a hidden ID GUID attached to it that the IDE uses internally.
So if, for example, you change the name of a variable in the data pad and then open the window designer in the IDE, the window designer will refresh itself and be using the correct (new) variable name.

Thanks Jane, I now see those tags that the system adds when I look at the SIMPLE/COMPLEX drop down