APPX is the Premier Development and Runtime Environment for Business Application Software
(Category) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment :
Tips & Techniques
Tips & Techniques relating to APPX design.
Subcategories:

Answers in this category:
(Answer) How can my APPX process tell if a user is running the GUI client?
(Answer) Is it possible to suppress the binoculars on a field that has a DLU defined?
(Answer) How to build a UNIX script to run an APPX process (cron job).
(Answer) How to refresh parent screen after a child process.
(Answer) How do I send a file to a client PC and open the file with a client side App? (i.e. Excel)
(Answer) How can I import consecutive (flat) files into APPX?
(Answer) Checking return code after a Stream Write.
(Answer) How can I run a constrained input process via ILF?
(Answer) Is it possible to get APPX to automatically convert Gregorian date fields to Julian dates?
(Answer) How to determine IO mode (READ,WRITE,HOLD) within a FLEP
(Answer) How to create dynamic rollover tool-tips.
(Answer) How to play sounds.
(Answer) What is pdf "---ENTRY SELECTED PATH" used for?
(Answer) How do you create a vertical or horizontal line on an input image?
(Answer) How do I keep production applications from accidentally being changed?
(Answer) Scope of cached files!
(Answer) How data sharing is accomplished in APPX!
(Answer) What is the difference between file content and file stream?
(Answer) What does scope refer to?
(Answer) What is the scope of a work field?
(Answer) Can I change the date and time APPX uses for testing date/time sensitive applications?
(Answer) How can I read the USER list?
(Answer) How to make a negative sign appear in front of the number (instead of behind)
(Answer) How to display high ASCII characters.
(Answer) How to get User Security Codes using ILF.
(Answer) How to QUERY/INPUT via Cache!
(Answer) How to get the name of the Parent Process.
(Answer) GUI themes via ILF!
(Answer) Example of a random number generator using ILF!
(Answer) How to retrieve an occurrence number with ILF!
(Answer) How to see a trace of executed process
(Answer) Use of --- DEFAULT MODE
(Answer) How to determine a leap year!
(Answer) How can I position a widget exactly where I want it?
(Answer) Can we colorize the "auto gui" widgets by ILF in order to adapt them to color schemes?
(Answer) Help in debugging AppxIO
(Answer) How to put multiple of lines of text on a button or label widget.
(Answer) How to add pulldown menu entries with ILF
(Answer) How to close an external ASCII file (RT_CLOSE_STREAM)?
(Answer) How to read data to an external ASCII file (RT_READ_STREAM)?
(Answer) How to write data to an external ASCII file (RT_WRITE_STREAM)?
(Answer) How to open an external ASCII file (RT_OPEN_STREAM)?
(Answer) How to put APPX in sleep (pause) mode (RT_SLEEP)?
(Answer) How to get the current process parent name (RT_GET_PROC_NAM)?
(Answer) How to get the APPX runtime parameters (RT_GETPARAM)?
(Answer) How to get the environment variables (RT_GETENV)?
(Answer) Dynamic linking using the CALL statement.
(Answer) How to access APPX Query parameters.
(Answer) How do you call a window API function?
(Answer) How do you copy from one application database to another within APPX.
(Answer) How to display detailed data from a scrolling input.
(Answer) How to read EXCEL files from Appx.
(Answer) How do I search the electronic APPX manual(s) for multiple keywords?
(Answer) The underline character is not displayed under the shortcut letter!
(Answer) How to get printer friendly pages from the APPX web site.
(Answer) How do you run an os command and pipe the results through a stream read?
(Answer) Now that I can generate PDF files from APPX, how can I get the PDF to display as such in a browser?
(Answer) What is the correct Date Mask for: Apr 13 09:23:00 2004?
(Answer) Can Current Release of Appx support LDAP?
(Answer) How does LOCAL and RECEIVE statements work?
(Answer) Can i have environment variable APPX_41_EPS set while designing in 4.2?
(Answer) I noticed that all of a sudden i have Applications tab on my Java client. How did it get there and how to get rid of it?
(Answer) I have set my --- OPTION = END PARAGRAPH, but it doesn't seem to do anything. Why is that?
(Answer) I am trying to PASTE a statement into the ILF editor, but it put "**" in the front of it and it looks miss-aligned. What did i do wrong?
(Answer) Is there a way to get rid of the automatic drop down menus that appear on my GUI menus processes?
(Answer) Is there a way to get rid of the big red X (Cancel) and the green arrow (Return)?
(Answer) Is there a way to set child constraints on a data lookup field in an Input Process?
(Answer) How can I wait on Windows-systems without consuming CPU?
(Answer) I am using a --- STREAM WRITE call on a file that is > 2GB. It doesn't crash or return an error code, but it doesn't write to a file either
(Answer) When I execute SLEEP command from an Appx CALL i get the error 'You've CALL'ed C:\WINDOWS\SYSTEM32\kernel32.dll,Sleep with the wrong calling convention'
(Answer) How can i set default values during data entry and make Appx remember them from one entry to the next one?
(Answer) Copying Files between Databases/Versions
(Answer) Adding new fileds with defualt values to an existent file
(Answer) I have an ALPHA field with a validation table, but it allows for any value to be entered, regardless of the validation table values
(Answer) What is the proper usage of --- STREAM READ LENGTH field?
(Answer) Can the STREAM READ look for the presence of the \r character as a record delimeter?
(Answer) The --- COMPARE file contains the fields that are different after an IF DIFF is executed. If a field has multiple occurances, how can I tell which occurance changed?
(Answer) How to create a PDF Form Overlay
(Answer) How to create an ASCII fixed length flat file using Appx
(Answer) Execution Cycle in Appx 4.2
(Answer) Under what circumstances you need to set NLS_LENGTH_SEMANTICS

[New Answer in "Tips & Techniques"]
2008-May-13 2:38pm
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
How can my APPX process tell if a user is running the GUI client?
Is there a way in ILF to determine what type of client the user is using to run APPX? For example, if a user is running a "text" client, we want to display a text menu. But, if the user is running a GUI client we want to display a GUI menu.

      GOSUB    --- CHECK GUI CLIENT
      IF       --- RETURN CODE        EQ     1
T     *        Running with a GUI client
F     *        Running with a character client
[Append to This Answer]
2003-Nov-06 6:17am
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
Is it possible to suppress the binoculars on a field that has a DLU defined?
The APPX GUI Client automatically creates a binoculars icon that is attached to the right-hand side of any field that has a DLU (data look-up) defined. Is there any way to suppress this auto-GUI feature?
There isn't a design specification or runtime "preference" to control whether or not the APPX GUI Client appends the binocular icon to a data lookup (DLU) field. The client doesn't use an external picture file but rather has the binocular icon compiled into the Java code. This means that you cannot simply swap one icon file with another. However, APPX will only append the icon if there are two blank spaces immediately to the right of the DLU field. So, an indirect method of eliminating the icon would be to make sure that one of the two fields is not blank. Type a "." or "*" or place a MODIFIABLE field immediately to the right of the field to suppress the binoculars. If you had your own icon you wished to display or wanted to display the non-modifiable look up value (field), create that widget on the screen and then drag it over the "*".

While overriding this “standard behavior” is possible, there are serious program maintenance issues that should be considered.

[Append to This Answer]
2007-Oct-05 5:00pm
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
How to build a UNIX script to run an APPX process (cron job).
To run a background process (cron job) in UNIX, build a script as follows;


  export APPXPATH=/appx/appx350/data
  export TERM=ibm3151
  su - xxx -c "/appx/appx350/appx -s -d=ddd -a=TRN -t=JOB -p=BATCH_CYCLE" 1>/dev/null 2>/dev/null


The first export command is the APPXPATH directory for your APPX installation.
Example: /appx/appx350/data 


The second export command defines the terminal type.  Example: ibm3151.  Even
thought the process is running in the background, the terminal type must be
defined.


The su command line parameters:

     xxx is the o/s userid of who is running this process
        -c " then the APPX application path
        -s tells APPX to automatically pass through any entry screens
           like sort and disposition that might be encountered.
        -d ddd is the database id of the APPX application
        -a application id
        -t process type, most likely a JOB
        -p the name of your process followed by ".  The underscore maintains
           the space you may have in the APPX process name.
        1> and 2> tells appx to send interactive message to the null device.
           These two parameters are to be included in the su line.  

Of course you would have one script for each process you wanted to run in
background.
[Append to This Answer]
2004-Jan-27 3:11pm
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
How to refresh parent screen after a child process.
APPX 4.1
If a child process is invoked from an input process and the child process modifies a displayed data element from the PCF, you can instruct APPX to redisplay the parent screen by putting a DISPLAY statement (no Application Id or Field name) in the Post Invocation of the child process. The data processed in the child may have to be re-written depending on the type of child being invoked.

APPX 4.2
Starting with APPX 4.2, the parent screen is automatically redisplayed when returning from a child process. The DISPLAY statement in the child’s Post Invocation Event Point is not needed.

[Append to This Answer]
2004-Jan-15 5:52am
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
How do I send a file to a client PC and open the file with a client side App? (i.e. Excel)
The following code sends the file from the server to the Windows client PC and runs a command on the client. You need the Java client for this to work. This example sends a spreadsheet file and launches Microsoft Excel to open the file on the client.
      *
      *        Send the file to the client
      *
      SET      --- TEMP 80                    =      /tmp/info.csv
      SET      --- TEMP 132                   =      c:\temp\info.csv
      PASS     --- TEMP 80                    FIELD            SHARE? Y
      PASS     --- TEMP 132                   FIELD            SHARE? Y
      CALL         ,RT_SEND_FILE              RESIDENT? N  END? N  FAIL 0
      *
      *        Run Excel and open the file
      *
      SET      --- TEMP 256                   =      @
      APPEND   --- TEMP 256                   0      "C:\Program Files\Micr
      APPEND   --- TEMP 256                   0      osoft Office\Office\EX
      APPEND   --- TEMP 256                   0      CEL.EXE"
      *
      APPEND   --- TEMP 256                   1      c:\temp\info.csv
      *
      SET      --- LI                         =      256
      PASS     --- TEMP 256                   FIELD            SHARE? Y
      PASS     --- LI                         FIELD            SHARE? Y
      CALL         ,RT_LOAD_URL               RESIDENT? N  END? N  FAIL 0
      *
See also: (Xref) Diagnose SUBR --- SEND FILE TO CLIENT problems
_
[Append to This Answer]
2003-Dec-09 4:24pm
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
How can I import consecutive (flat) files into APPX?
APPX users often find the need to import data from external sources into APPX. What methods can be used to bring consecutive (flat) data files into the APPX database files?
Here are three approaches:

1. If the file is "columnar" (all the data lines up into columns, and all the records have the same fixed length), define an APPX Data Dictionary file and fields corresponding to the columns for the fields, and read it directly. Have a 2-byte alpha field at the end, the 'absorb' the hex(0d0a) that Windows apps usually put on the end of each of the line, to denote end of line. See "to import a flat file" below.

2. Create an APPX consecutive file with a single 1-byte alpha field. Use it to read the text file into APPX, one byte at a time. Build a record buffer, testing for hex(0d0a) to determine the end of each record, and then writing it out to the file.

3. Using the ",RT_" commands to read the file. 'RT' commands are unsupported and subject to modification, but are often used for these sorts of tasks. We use them in the UPDATE process generated by our "Comma Delimited Update" process within Utilities/Toolbox. You might look at an UPDATE generated by this utility, to get a feel for how the commands work.

To import Tab delimited variable length files into APPX, check this document from "Sparky and Spike" at CANSYS West: http://www.cansyswest.com/importin.htm

--------------------------------------------------------------------------------
To import a flat file into APPX (for example, from an Excel spreadsheet) try the following:

1. Export the file from Excel into a fixed length format.

2. Define a Consecutive file in APPX, with all Alpha fields, matching the column widths of each Excel column, as exported.

3. Add a 2 byte alpha at the end of the APPX DD, to receive the hex(0d0a) that Excel and other Windows applications append to records to denote record boundaries.

4. Design Transfer the design for the Consecutive file defined above into a 2nd APPX file.

5. Change the field types you want to be other than Alpha, into their other field type. (Numeric, Date, or whatever.) Add indices.

6. Run 'Create Files' on both the Consecutive and Indexed files.

7. FTP the file to your Unix box in ASCII format.

8. Move the FTP'd file into your Data directory as the name of the Consecutive f ile. (Filename is all upper case, with a lower case .dat suffix.)

9. Write an OUTPUT that reads the Consecutive file and reports on its contents.

Within the 'Select Image' event point, write ILF that moves field contents from the Consecutive file into the Indexed file. Write the new record.

If you try to write two records with the same Primary or Unique Key, the WRITE will fail. Check the False condition on a WRITE to catch that and handle it accordingly.

Set --- ALTERNATE IMAGE NUMBER in Select Image to selectively display/print records of interest.

Date fields will require special manipulation. Use SET TEMP commands, to get them into APPX date format.

Run the above OUTPUT on this FTP'd file, converting it from Consecutive into Indexed format. Examine the resulting files. Modify your OUTPUT as needed.

[Append to This Answer]
2003-Nov-18 3:07pm
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
Checking return code after a Stream Write.
In 4.1.a under Windows, the Stream Write always returns a failed (False) condition. You can't test the return code, you can only assume it worked.
[Append to This Answer]
2003-Nov-20 11:19am
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
How can I run a constrained input process via ILF?
APPX does not provide a direct method of running a constrained INPUT process via ILF. However, you can define a JOB process that runs the INPUT process constrained and you can run the JOB process via ILF. Be sure to run the JOB process with an invocation type of SUBPROCESS so that the constraint fields will be available within the JOB.
[Append to This Answer]
2003-Nov-22 10:24am
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
Is it possible to get APPX to automatically convert Gregorian date fields to Julian dates?
A display mask of 555 will display the Julian day number. A mask like "8807 - 555" would display a date as 2004-247 for example.
[Append to This Answer]
2003-Nov-24 9:19am
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
How to determine IO mode (READ,WRITE,HOLD) within a FLEP
Is it possible to tell inside a FLEP whether it is being called from a READ or a READ w/ Hold? Or whether it's being called from a WRITE or REWRITE?
The --- MODE PDF should tell you this information. READ with HOLD sets MODE = CHANGE, without HOLD sets MODE = INQUIRE. On the PCF update event points it sets MODE = ADD for a WRITE and MODE = CHANGE for a REWRITE, MODE = DELETE for a DELETE.
[Append to This Answer]
2004-Jan-07 2:14pm
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
How to create dynamic rollover tool-tips.
To create rollover tooltips dynamically from ILF at runtime, get (or create) the WIDGET record, populate it’s WIDGET TOOLTIP (text 60) field with the desired text, and WRITE it to the widget file.
[Append to This Answer]
2003-Nov-24 9:34am
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
How to play sounds.
APPX 4.2

The --- PLAY SOUND command ( audio subroutine ) in ILF will support .wav, .au, and .aiff file formats.  Examples;


      SET      --- TEMP 512                   =      /home/pete/test.wav
      PASS     --- TEMP 512                   FIELD            SHARE? N
      GOSUB    --- PLAY SOUND

                                                                        
      SET      --- TEMP 512                   =      file:///home/pete/test
      APPEND   --- TEMP 512                   0      .wav
      PASS     --- TEMP 512                   FIELD            SHARE? N
      GOSUB    --- PLAY SOUND

                                                                        
      SET      --- TEMP 512                   =      http://www.wavsite.com
      APPEND   --- TEMP 512                   0      /sounds/62369/grail22.
      APPEND   --- TEMP 512                   0      wav
      PASS     --- TEMP 512                   FIELD            SHARE? N
      GOSUB    --- PLAY SOUND
[Append to This Answer]
2003-Dec-01 4:26pm
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
What is pdf "---ENTRY SELECTED PATH" used for?
"--- ENTRY SELECTED PATH" is not documented because it's really for internal use only (and it will change, so don't use it).
You can use the "--- ACCESS PATH" pdf to determine which key field is currently in use. Unfortunately, that's a read-only PDF so you can't conveniently change back just by setting it again.
[Append to This Answer]
2003-Dec-08 9:42am
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
How do you create a vertical or horizontal line on an input image?
APPX 4.2
Appx doesn’t have a Line widget however starting in release 4.2 you can create lines using the following techniques. To get a horizontal line, add a box widget to the screen and set the height adjustment parameter to -90. To produce a vertical line, create a label widget with the height adjustment set to -80. Note that the use of negative values are supported in release 4.2 (and up) only.
[Append to This Answer]
2003-Dec-18 2:58pm
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
How do I keep production applications from accidentally being changed?
Go to:

Appx main menu > System Administration > Databases/Applications > Applications.

Select the application you want to protect from changes. Press ENTER to go to the popup continuation window. Turn off the flag in the lower right of that window called "Allow Design?".

This makes that application "Inquire Mode Only" from within application design.

Release 4.2 was change to have the default mode in Application Design be Inquire rather than Change mode. Part of the reasoning behind that decision was to assist in protecting applications from accidentally being changed.

[Append to This Answer]
2004-Jan-15 5:59am
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
Scope of cached files!
When you create a cached version of a file, the contents are treated as a temporary detached memory file. You still have to choose whether each stream is attached to the cache file or the base file (see the topic, “What is the difference between file content and file stream?”).

You create the cache once, but you use OPEN-CACHE?=Y to control each stream. You can switch a given stream back and forth between the cached and base files by executing OPEN statements.

When Appx creates a file stream, it uses the base. If you have file A open in a process, and then invoke a subprocess child, we don't open file A again (and we don't create a new stream). The child shares the parent's stream. You can prove that to yourself by putting a TRAP in the File-level Open event point for file A - it won't get hit when you invoke the child process.

In the case of cached files, the file contents are always created in the first stack frame (i.e. the cached file contents are detached). The file stream always has a subprocess scope.

Here's a test scenario to illustrate how this works. I defined a simple permanent index file with two fields, TESTSCOP NUMBER and TESTSCOP NAME. Then I created a simple scrolling input process (TESTSCOP as the PDF) and entered five test records. I painted --- CHILD ID on the header frame to make it easier to see which input process was running. Next, I wrote a job that invoked the input process six times:

      CHILD ID  Invocation Type  Pre-invocation Open?   
      --------  ---------------- --------------------   
      1ST       Subprocess       No                     
      2ND       Subprocess       Yes - open cached      
      3RD       Subprocess       No                     
      4TH       Related          No                     
      5TH       Subprocess       No                     
      6TH       Subprocess       Yes - open base        
Here are the steps and results:

When the job runs, the first child displays data in the base file (PDF).

In the pre-invocation event point of the 2ND child, I CREATE the cache (type = LOAD), then OPEN the cache, then looped thru each record and appended the word CACHED to each name field. So now the base file is unchanged, but the cache file has the word CACHED in every record. When the 2ND child process runs, it displays the cached file.

When the 3RD child runs, I see the cached records because the stream is shared between the parent and children 2 and 3 (and 5 and 6).

The 4TH child is invoked related. Stream objects are not shared with related invocations, so the base PDF records are displayed.

The 5TH child is invoked subprocess and is identical to the 3RD. I added this child to illustrate that the file contents are persistent. The 5TH child shows the cached records.

In the pre-invocation event point of the 6TH child, I OPEN the CUST file, this time with CACHE set to NONE. The 6TH child displays the base records, as expected.

[Append to This Answer]
2004-Jan-15 5:41am
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
How data sharing is accomplished in APPX!
Each process refers to a list of objects (we call them areas internally). An object is a record buffer, a work field, file contents, or a file stream. (There are a few other object types, but we'll ignore them for now).

When you invoke a process, APPX pushes a stack frame onto the process execution stack. A stack frame contains a set of objects. Important point: a process (actually an EM) contains a set of references, a stack frame contains a set of objects.

Data sharing matches each reference to the appropriate object.

When a process is invoked, APPX walks through the list of references and determines which stack frame should contain the corresponding object.

If a process has no parent (i.e. it is the first process), all objects are created in the first stack frame. If a process has a parent, we look at the sharing characteristics of the object and of the ancestor processes. If the object is shared with subprocesses, we stop traversing the stack as soon as we encounter a related or detached invocation. If the object is shared with related processes, we stop traversing the stack as soon as we find a detached invocation. If the object is shared with detached processes, we stop when we find the first stack frame.

For example:

  Process A
          |
       detached
          |
  Process B
          |
       related
          |
  Process C
          |
      subprocess
          |
  Process D
          |
      subprocess
          |
  Process E
Let's say that you have just invoked process E (which is a subprocess child of process D, which is a subprocess child of C, which is a related child of B...).

We now process the list of references in process E's EM. If we find a reference to a private object (i.e., one that should never be shared, such as --- PROCESS TYPE), we create the object in process E's stack frame. If we find a reference to an object that should be shared with subprocesses, we look back up the stack until we find the most recently invoked related or detached process; in this case, process C. We create any subprocess-scoped objects in the stack frame for process C. If we find a reference to a related object, we look back until we find the most recently invoked detached process (in this case process B) and create related-scope objects in that stack frame. If we find a reference to an object when should be shared with detached invocations (such as --- USER ID), we create them in the first stack frame.

As we process each reference, we locate the desired object (creating it required) and point the reference to the object. That means that the references for a particular invocation can point into four different stack frames (private, subprocess, related, and detached).

Looking back at the stack frame above, consider what will happen when process E ends. All objects private to E are destroyed, but what about other objects? Any subprocess-scoped objects were created in the stack frame for process C so they are not destroyed until process C ends. There are some interesting consequences to this. First, the stack frame for any given invocation can contain objects that are not referenced by that process.

For example, if process E refers to a field named WORK TOTAL (subprocess-scoped), that object is created in C's stack frame even if process C does not refer to WORK TOTAL. Now when process E ends, WORK TOTAL is not destroyed - it lives in C's stack frame until C ends. Let's say that, after process E ends, process D invokes process F (so E and F are siblings even though E dies before F was born). If process F refers to WORK TOTAL, it will find that object in process C's stack frame - in fact, WORK TOTAL will reflect the last value assigned by process D.

[Append to This Answer]
2004-Jan-15 6:03am
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
What is the difference between file content and file stream?
There are two parts to a file: the file contents, and the file stream. File contents can be permanent or temporary. If temporary, the contents can be scoped as subprocess, related, or detached. The file stream is always subprocess.

That means that if you have a stream positioned at record 10, and invoke a child as a subprocess, and READNEXT within the child, you will be sharing the stream with the parent and the parent will now be positioned at record 11. On the other hand, if you invoke the child as related or detached, the child has its own stream and a READNEXT will not affect the parent's stream.

A stream has four components:

  -  readnext position (record number/key value plus key path)
  -  an optional record lock
  -  a record buffer
  -  pointer to cached or base file

[Append to This Answer]
2004-Jan-15 6:04am
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
What does scope refer to?
Please go to http://www.appx.com/assets/asp/dynamic_generator.asp?pageid=656 for a detailed explanation of scoping as it applied to APPX.
[Append to This Answer]
2003-Dec-22 3:35pm
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
What is the scope of a work field?
Input#1 calls Input#2 with a 'scope' of Subprocess, Related, or Detached. Work fields (and work files) are also defined with scopes of Subprocess, Related, or Detached.

The following rules apply:

A Subprocess work field will only survive a Subprocess level of Process Invocation.

A Related work field survives both Subprocess and Related Process Invocations.

A Detached work field survives all Invocations (and in general survives until the user exits Appx).


                            Input Process Invocation Type
              ------------------------------------------------------------
              | Invocation Type   | SubProcess |  Detached  |   Related  |
              |-------------------|------------|------------|------------|
              |                   |            |            |            |
              | SubProcess        |    Yes     |     No     |     No     |
  Work Field  |                   |            |            |            |
  Invocation  | Detached          |    Yes     |     Yes    |     Yes    |
  Type        |                   |            |            |            |
              | Related           |    Yes     |     No     |     Yes    |
              |                   |            |            |            |
              ------------------------------------------------------------
Yes=Work field is passed No=Work field is not passed

[Append to This Answer]
2004-Jan-15 6:09am
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
Can I change the date and time APPX uses for testing date/time sensitive applications?
Yes, there is an environment variable called APPX FAKE TIME that you set to what looks like a starting date/time. Then run APPX and it uses this as the starting date/time for the session (i.e. the clock ticks forward from that date time as time rolls forward).

 If you ...
          export APPX_FAKE_TIME="2001061510000000"
          appx

 ... you get a date/time of ...
          6/15/2001 8:00am

 ... and the clock ticks forward from there as time goes by.

[Append to This Answer]
2004-Jan-15 6:11am
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
How can I read the USER list?
The following code will traverse the USER list.

   BEG READ 0SA USER      HOLD 0      KEY IS
   SET      0SA USER ID            =  0SA USER ID
   SET      0SA USER NAM           =  0SA USER NAM
   END READ 0SA USER

When you enter the BEG READ into the ILF editor, it will give you a message "WARNING - File not found", which you can ignore (option 88).

Be very careful what you do with these techniques, as THEY ARE NOT SUPPORTED BY APPX SOFTWARE, and may change without notice.

[Append to This Answer]
2003-Dec-31 8:57am
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
How to make a negative sign appear in front of the number (instead of behind)
First, go to the Data Dictionary for the numeric source field, and enter a default display mask with the minus sign whenever you want it. Note: You can also put currency symbols, commas, and anything else you might need.

Then, in the process where you want to move it to an alpha, you just say:

             CNV TEXT <alpha field> = <numeric field>

The CNV TEXT field will honor the default display mask, and put the minus sign where you want. If you put currency symbols, commas, etc, they will also be formatted into the alpha field. The same thing applies if you use a date field as the source, APPX will format the date according to the date mask, so you don't get '20010517--------', you get '5/17/2001'.

APPX will use your default mask in other places as well, which may or may not be a good thing (inputs and outputs that use the numeric field will be affected). If you are concerned about that, you can create a new numeric field with the default mask you want, SET the original field into the new one, and then use CNV TEXT.

[Append to This Answer]
2004-Jan-07 2:16pm
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
How to display high ASCII characters.
To get the degree symbol (ASCII 176), for example, onto APPX OUTPUT and INPUT screens.

Depending on what version of APPX you are using and how you are accessing it, you may be able to hold down ALT, use the numeric keypad to type the ascii code value in decimal, and release ALT, to enter that ASCII char.

Or you can do it with ILF code;

 SET OWN WF ASCII CODE = 176
 CNV BIN OWN WF ALPHA 1

 ... where WF ALPHA 1 is painted on the report or screen. The other variable
 is a three-digit numeric field.

[Append to This Answer]
2003-Dec-31 1:13pm
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
How to get User Security Codes using ILF.
Is there a general way for the Application designer to manually control
process behavior, based on Security?  For example I would like to 'hide' 
optional children, if the user does not have the required security.  Can I 
determine the security key of the process in ILF?

You can read the 0AD PROCESS file to find out the security class that might 
be assigned to a process.

You can then set up a memory indexed file with a single field of Alpha(4).
Define it as the Record Access security field.  Then, from ILF set the field
to the security code you want to test, write it, and then try to read it back.  If you can't read it back, then you don't have access to that security code.

Details:

1) Create a memory file with one field designated as the RECORD PROTECT
   field, as follows:

2) Make sure that you set the Record Access field for the file as follows:
        
    Record Protection Fields            
        Delete Protection = blank
        Key Protection = blank
        Record Access = SECURITY_CODE

3) The following ILF code will create and populate the memory file and test
   for a specific code.  The READ returns a true if the user has access to the
   specified code.  The READ returns a false is the user does not have access
   to the specified code.

      SCRATCH  SPF SECURITY            FAIL 0 CACHE? N
      CREATE   SPF SECURITY  SHARE? Y  FAIL 0 CACHE NONE
      *        The write will always succeed
      SET      SPF SECURITY CODE              =      0001
      WRITE    SPF SECURITY               FAIL 0
      *        The read will fail if the user does not have access to code 0001
      SET      SPF SECURITY CODE              =      0001
      READ     SPF SECURITY               HOLD 0 FT 0 BY SECURITY CODE
F     ERROR    User Doesn't Have Access To Code 0001
[Append to This Answer]
2004-Jan-02 10:54am
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
How to QUERY/INPUT via Cache!
When you want a QUERY to constrain an INPUT process (the regular INPUT Child 
Constraints can't be satisfied using CC's 'EQ' comparison operator only), you 
can use the following technique:

Create a JOB with Job Steps:
    QUERY
    UPDATE   (uq=query)
    INPUT

All three processes use the same PCF.

The UPDATE's Start of Process is:

      SCRATCH  AAA FILENAME              CACHE? Y
      CREATE   AAA FILENAME   SHARE? Y   CACHE? NOLOAD
      OPEN     AAA FILENAME   SHARE? Y   CACHE? N

The UPDATE's Record frame contains only:

      OPEN     AAA FILENAME   SHARE? Y   CACHE? Y
      WRITE    AAA FILENAME
      OPEN     AAA FILENAME   SHARE? Y   CACHE? N

The INPUT's JobStep's Pre-Invocation sets the following detached workfield:

      SET      AAA WORK USE-CACHED-PCF        =      1

The INPUT's Start of Process contains:

      IF       AAA WORK USE-CACHED-PCF        EQ     1
 T    OPEN     AAA FILENAME   SHARE? Y   CACHE? Y

The INPUT's Post-Invocation sets:

      SET      AAA WORK USE CACHED PCF        =      0

This example does not pass changes to the CACHEed version on to the disk 
version.  You'd have to put code in the INPUT's End of Process for that.
[Append to This Answer]
2004-Jan-02 11:22am
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
How to get the name of the Parent Process.
There is an internal APPX subroutine which can be used to retrieve the name of the parent process to the current process.

 GOSUB --- GET PARENT PROCESS

 ... then check the values of:

 0AD WORK PROC TYPE
 0AD WORK PROC NAM
 0AD WORK AP

[Append to This Answer]
2005-May-03 11:40am
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
GUI themes via ILF!
If you want theme-like behavior, you can implement at least a portion of it yourself, so that you can get a consistent look and feel for your buttons (or other gui elements).

What you would do is create a standard subroutine that reads all WIDGET records, looking for widgets of X type (like button). When it finds a widget of that type, it could set the font, text, rollover colors, etc.

Then, call this subr in Pre-Display of any process you want to have the consistent look and feel.

One enhancement you could do is put all the attrs in a one-rec param file, so that you can change them on the fly at run-time without having to touch the code.

This works only for setting attributes for existing GUI elements, and doesn't let you create new elements and add them to processes on the fly (for example, if you want a standard button to always appear on the bottom line of all INPUT processes).

[Append to This Answer]
2004-Jan-02 4:07pm
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
Example of a random number generator using ILF!
The follow sample will work for any range of numbers where the total numbers
in the range is a maximum of 10,000 (eg., 1 - 10000, 50000 - 60000, 
1678  -11678).  If you use a larger range, you will need to increase the
generating time (TI) by some factor to allow at least one full pass through
the range of numbers.

 
     *        Set start and end of desired number range.
     SET      --- AI                         =      1
     SET      --- ZI                         =      10000
     *        Use current time to get random number of seconds & hundredths
     *        (WORK RGEN TIME SS defined as date field with seconds only)
     *        (WORK RGEN TIME TH defined as date field with hundredths only)
     SET DATE 1EX WORK RGEN TIME SS
     SET      --- SI                         =  1EX WORK RGEN TIME SS
     SET DATE 1EX WORK RGEN TIME TH
     SET      --- TI                         =  1EX WORK RGEN TIME TH
     *        Add number of seconds to number of hundredths
     COMPUTE  --- TI                         +  --- SI
     IF       --- TI                         LT     1
T    SET      --- TI                         =      1
     *        Set Number counter to one less than specified start of range.
     SET      --- NI                         =  --- AI
     COMPUTE  --- NI                         -      1
     *        Calculate time to stop generator by starting at current time
     *        and increasing it by adding the value in TI to the th's part.
     *        (WORK RGEN RUN END defined as date field with YY thru th)
     SET DATE 1EX WORK RGEN RUN END
     DATE ADD 1EX WORK RGEN RUN END          1  --- TI
     *        Start infinite loop that will exit when end time is reached.
     BEG LOOP LI = 001 TO 001  STEP 000
     COMPUTE  --- NI                         +      1
     *        If number count reaches end of range, go back to start.
     IF       --- NI                         GT --- ZI
T    SET      --- NI                         =  --- AI
     *        If current time has reached end time, exit loop.
     *        (WORK RGEN RUN START defined as date field with YY thru th)
     SET DATE 1EX WORK RGEN RUN START
     IF       1EX WORK RGEN RUN START        GE 1EX WORK RGEN RUN END
F    END LOOP LI
     *          ==>  Resulting generated number is in ---NI
[Append to This Answer]
2004-Jan-02 4:14pm
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
How to retrieve an occurrence number with ILF!
Retrieve and occurrence example:
     TRN WORK DATE occurs 66 times (DD)         
        . . .
     SET --- TEMP 30     =     WORK DATE (note this is a literal)
     SET 0AD ELEMENT NAM = --- TEMP 30
     READ 0AD ELEMENT  HOLD 0 FT 0 BY ELEMENT NAM 
     SET --- AI = 0AD ELEMENT OCC

AI will contain 66 in this example.
Now in 4.2 you can use the two new PDFs --- CURSOR AT APPLICATION and --- CURSOR AT FIELD
just in case the user happened to be sitting on the field of interest.
...
     SET --- NEXT APPLICATION = --- CURSOR AT APPLICATION
     OPEN 0AD ELEMENT
T    SET --- TEMP 30     = --- CURSOR AT FIELD
T    SET 0AD ELEMENT NAM = --- TEMP 30
TT   READ 0AD ELEMENT  HOLD 0 FT 0 BY ELEMENT NAM 
...
I haven't tested this to see if it really works and I'm not sure if the
T    SET --- TEMP 30     = --- CURSOR AT FIELD
would really be required.
[Append to This Answer]
2004-Jan-14 6:21pm
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
How to see a trace of executed process
There is a very useful utility to examine the 'stack' of Appx Processes you invoked, to get down to the currently executing Appx Process:

     --- Input   STACK (EDIT)

This ILF must be coded within an image level EP. Run against any Database.

This is most convenient if you define it as your SysAdmin 'Direct Process 1', or if you put it on a Direct Process 1 menu. Then, in a trapped routine, you can invoke direct process one, cntl+1. This will display the process stack which shows the process name, process type and invocation type. For a detailed description of the process stack see http://www.appx.com/assets/asp/dynamic_generator.asp?pageid=171 .

[Append to This Answer]
2004-Jan-07 2:19pm
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
Use of --- DEFAULT MODE
Setting PDF (--- DEFAULT MODE) before invoking an INPUT process, specifies the initial mode of the INPUT process. In addition to setting the desired value into the PDF, you must ...

 1) Ensure that the INPUT process does not specify a "Default Mode" 
   (which it always does)

 2) Ensure that the child spec does not specify an "Override Default Mode"
    (which it normally doesn't)

 3) Invoke the INPUT process with an invocation type of SUBPROCESS.  
    (--- DEFAULT MODE has a share class of SUBPROCESS.)

Think of INPUT Additional Attribute field "Default Mode" as "Initial Mode". Specifying "Default Mode" tells APPX to run the INPUT with that mode as the Initial Mode. APPX then ignores any value you might have set into the PDF.

If a parent INPUT process is running in Inquire or Change mode and you set the PDF to ADD mode before invoking a child INPUT, APPX runs the child INPUT process in Inquire or Change mode instead.

You can control the INPUT process mode by setting the desired mode into --- DEFAULT MODE in the child INPUT's Start of Process.

[Append to This Answer]
2004-Jan-06 4:13pm
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
How to determine a leap year!
Create a work date field as CC-DD, in the example below this work field is 
WORK DATE and the year I am checking is in WORK YEAR.

Using ILF:

        SET      TRN WORK DATE                      =     TRN WORK YEAR
        SET      TRN WORK DATE                      =     ----0229--------
        IF       TRN WORK DATE                      EQ    ------29--------
T       (the year in WORK YEAR is a leap year)

When 0229 is put in a date field that contains a year, APPX will determine 
if 0229 is valid for that year.  If it is, 0229 will remain.  If not, APPX 
date logic will convert the 0229 to 0301.  In the example above, the first 
SET puts the year in the CC-DD date field.  The second set puts Feb 29 into 
that year.  The IF checks to see if the day is still 29.  If it is, then this 
is a leap year.  
[Append to This Answer]
2004-Jan-07 2:20pm
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
How can I position a widget exactly where I want it?
Hold the shift key down when positioning something on the image using your mouse. This is a fairly common Windows key combination in various image editors, allowing exact positioning of objects, as opposed to the 'snap to grid' that APPX does by default.

The row and column position on the widget will still be the nearest row/col intersection, but the micro adjustment field will be filled in with the percentage adjustment away from that row/col. The same thing applies to drawing buttons, etc. - without the shift key you get 'snap to grid', but if you use the shift key, you can make it any size.

[Append to This Answer]
2004-Jan-20 10:18am
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
Can we colorize the "auto gui" widgets by ILF in order to adapt them to color schemes?
The "auto-GUI" capabilities of APPX come from two sources. Part of the auto-GUI is created by the "engine" in the form of WIDGET records that are modifiable. Another part of the auto-GUI is created by the client. The client part is not modifiable since there are no WIDGET records for that part. Future releases of APPX will shift more of the auto-gui to the engine leaving less for the client to synthesize.
[Append to This Answer]
2004-Feb-13 8:48am
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
Help in debugging AppxIO
If you're using AppxIO to store data, you can get a complete log of all file I/O by setting the following env. variables:

APPX_IO_LOG=filename APPX_FMT_IO_LOG=1

The first will tell Appx to log all AppxIO actions to filename. The second will tell Appx to format the log so that mere mortals can read it.

The log file will show all reads, readnexts, writes, deletes, and rewrites. Each entry will show a complete dump of the data being read, written, or deleted. For read operations, the log will show the key number and key value being retrieved.

You'll also see log entries for each process that runs so you can tell which process caused each I/O.

[Append to This Answer]
2004-Feb-19 4:29pm
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
How to put multiple of lines of text on a button or label widget.
Buttons and Labels on input screens and menus can use html to enhance the
text.  Enter the html code in the Label or Button text field in the object
property(ies).  Example; <html>Request<br>Ship Date will be displayed on two
lines.


----------------
|              |
|  Request     |
|  Ship Date   |
|              |
----------------

 

The caveat is that the individual lines delineated by the <br> formatting 
may not obey all the label's gui settings, CENTER for example.  


In the case of CENTER the justification is applied to all lines at though 
there all the length of the longest segement.  You can revised the html tag 
to center each line of the label as follows;

<html><p align="center">Request<br>Ship Date
[Append to This Answer]
2004-Jul-07 2:15pm
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
How to add pulldown menu entries with ILF
Here is a sample menu structure to create:

Daily
-- Transactions
----- Enter Transactions
----- Print Journal
Monthly
-- Postings
----- Balancing Report
----- Post Transactions

To create this, enter the following in pre-display:
*                                                                         
*        Restore and set defaults for creating CHILD widget records       
*                                                                         
   RESTORE  --- WIDGET                     DEFAULT RECORD                    
   SET      --- WIDGET PARENT TYPE         =      CHILD                      
   SET      --- WIDGET POSITION ROW        =      0                          
   SET      --- WIDGET POSITION COLUMN     =                                 
*                                                                         
*        Create the "Daily" top level pulldown                            
*                                                                         
   SET      --- WIDGET LABEL               =      Daily                      
   SET      --- WIDGET GROUP NAME          =                                 
   SET      --- WIDGET OPTION              =      USER 1                     
   SET      --- WIDGET SHORTCUT            =      D                          
   SET      --- WIDGET ADD TO MENU         =      Y                          
   GOSUB        :WRITE CHILD WIDGET                                          
*                                                                         
*        Create the "Transactions" pullout menu and attach to "Daily"     
*                                                                         
   SET      --- WIDGET LABEL               =      Transactions               
   SET      --- WIDGET GROUP NAME          =      Daily                      
   SET      --- WIDGET OPTION              =      USER 2                     
   SET      --- WIDGET SHORTCUT            =      T                          
   SET      --- WIDGET ADD TO MENU         =      Y                          
   GOSUB        :WRITE CHILD WIDGET                                          
*                                                                         
*     Create the "Enter Transactions" item and attach to "Transacti.." 
*                                                                         
   SET      --- WIDGET LABEL               =      Enter Transactions         
   SET      --- WIDGET GROUP NAME          =      Transactions               
   SET      --- WIDGET OPTION              =      USER 3                     
   SET      --- WIDGET SHORTCUT            =      E                          
   SET      --- WIDGET ADD TO MENU         =      Y                          
   GOSUB        :WRITE CHILD WIDGET                                          
*                                                                         
*        Create the "Print Journal" item and attach to "Transactions"     
*                                                                         
   SET      --- WIDGET LABEL               =      Print Journal              
   SET      --- WIDGET GROUP NAME          =      Transactions               
   SET      --- WIDGET OPTION              =      USER 4                     
   SET      --- WIDGET SHORTCUT            =      P                          
   SET      --- WIDGET ADD TO MENU         =      Y                          
   GOSUB        :WRITE CHILD WIDGET                                          
*                                                                         
*        Create the "Monthly" top level pulldown                          
*                                                                         
   SET      --- WIDGET LABEL               =      Monthly                    
   SET      --- WIDGET GROUP NAME          =                                 
   SET      --- WIDGET OPTION              =      USER 11                    
   SET      --- WIDGET SHORTCUT            =      M                          
   SET      --- WIDGET ADD TO MENU         =      Y                          
   GOSUB        :WRITE CHILD WIDGET                                          
*                                                                         
*        Create the "Postings" pullout menu and attach to "Monthly"       
*                                                                         
   SET      --- WIDGET LABEL               =      Postings                   
   SET      --- WIDGET GROUP NAME          =      Monthly                    
   SET      --- WIDGET OPTION              =      USER 12                    
   SET      --- WIDGET SHORTCUT            =      P                          
   SET      --- WIDGET ADD TO MENU         =      Y                          
   GOSUB        :WRITE CHILD WIDGET                                          
*                                                                         
*        Create the "Balancing Report" item and attach to "Postings"      
*                                                                         
   SET      --- WIDGET LABEL               =      Balancing Report           
   SET      --- WIDGET GROUP NAME          =      Postings                   
   SET      --- WIDGET OPTION              =      USER 12                    
   SET      --- WIDGET SHORTCUT            =      B                          
   SET      --- WIDGET ADD TO MENU         =      Y                          
   GOSUB        :WRITE CHILD WIDGET                                          
*                                                                         
*        Create the "Post Transactions" item and attach to "Postings"     
*                                                                         
   SET      --- WIDGET LABEL               =      Post Transactions          
   SET      --- WIDGET GROUP NAME          =      Postings                   
   SET      --- WIDGET OPTION              =      USER 14                    
   SET      --- WIDGET SHORTCUT            =      P                          
   SET      --- WIDGET ADD TO MENU         =      Y                          
   GOSUB        :WRITE CHILD WIDGET                                          
*                                                                         
END                                                                       
*                                                                         
*        Write WIDGET and increment POSITION ROW to create unique keys    
*                                                                         
   LABEL    :WRITE CHILD WIDGET                                              
   WRITE    --- WIDGET                 FAIL 0                                
-  COMPUTE  --- WIDGET POSITION ROW        +      1                          
F  GOTO     :WRITE CHILD WIDGET                                              
   RETURN    
[Append to This Answer]
2004-Feb-20 10:38am
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
How to close an external ASCII file (RT_CLOSE_STREAM)?
Please refer to;

http://www.appx.com/assets/asp/dynamic_generator.asp?pageid=693

The information above is incorrect. See the STREAM FILE (EXAMPLE) subroutine in the 1EX/00 application.
[Append to This Answer]
2004-Oct-05 10:09am
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
How to read data to an external ASCII file (RT_READ_STREAM)?
Please refer to;

http://www.appx.com/assets/asp/dynamic_generator.asp?pageid=693

The information above is incorrect. See the STREAM FILE (EXAMPLE) subroutine in the 1EX/00 application.
[Append to This Answer]
2004-Oct-05 10:10am
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
How to write data to an external ASCII file (RT_WRITE_STREAM)?
Please refer to;

http://www.appx.com/assets/asp/dynamic_generator.asp?pageid=693

The information above is incorrect. See the STREAM FILE (EXAMPLE) subroutine in the 1EX/00 application.
The information above is incorrect. See the STREAM FILE (EXAMPLE) subroutine in the 1EX/00 application.
[Append to This Answer]
2004-Oct-05 10:11am
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
How to open an external ASCII file (RT_OPEN_STREAM)?
Please refer to;

http://www.appx.com/assets/asp/dynamic_generator.asp?pageid=693

The information above is incorrect. See the STREAM FILE (EXAMPLE) subroutine in the 1EX/00 application.
[Append to This Answer]
2004-Oct-05 10:11am
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
How to put APPX in sleep (pause) mode (RT_SLEEP)?
Please refer to;

http://www.appx.com/assets/asp/dynamic_generator.asp?pageid=693
http://www.appx.com/assets/asp/dynamic_generator.asp?pageid=161

[Append to This Answer]
2005-Apr-15 8:42am
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
How to get the current process parent name (RT_GET_PROC_NAM)?
Please refer to;

http://www.appx.com/assets/asp/dynamic_generator.asp?pageid=693

[Append to This Answer]
2004-Mar-02 9:13am
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
How to get the APPX runtime parameters (RT_GETPARAM)?
Please refer to;

http://www.appx.com/assets/asp/dynamic_generator.asp?pageid=693

[Append to This Answer]
2004-Mar-02 9:14am
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
How to get the environment variables (RT_GETENV)?
Please refer to;

http://www.appx.com/assets/asp/dynamic_generator.asp?pageid=693

[Append to This Answer]
2004-Mar-02 9:14am
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
Dynamic linking using the CALL statement.
Please refer to:

http://www.appx.com/assets/asp/dynamic_generator.asp?pageid=649

http://www.appx.com/ftp/appx/conference/presentations/InterfacingWithExtSubrs.doc
[Append to This Answer]
2005-Oct-13 11:42am
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
How to access APPX Query parameters.
Please refer to;

http://www.appx.com/assets/asp/dynamic_generator.asp?pageid=647

[Append to This Answer]
2004-Mar-02 9:18am
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
How do you call a window API function?
Please refer to;

http://www.appx.com/assets/asp/dynamic_generator.asp?pageid=628

[Append to This Answer]
2004-Mar-02 9:18am
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
How do you copy from one application database to another within APPX.
To copy all CUSTOMER records from one database to another:

    SET       --- NEXT DATABASE   =    DB1
    OPEN      TAR CUSTOMER        SHARE? Y FAIL 0
    *
    BEG READ  TAR CUSTOMER        Hold? N
    *
    *         The DB1 Customer file is currently accessible
    *         through the CUSTOMER file name - we just read 
    *         a record from the DB1 Customer file.  Now we 
    *         Want to write this record to the DB2 Customer
    *         file - have to open it first
    *
    SET       --- NEXT DATABASE   =    DB2
    OPEN      TAR CUSTOMER        SHARE? Y FAIL 0
    WRITE     TAR CUSTOMER                 FAIL 0
    F CANCEL unexpected error (duplicate key?) WRITEing CUSTOMER 
    *
    *         Now we have to switch databases again before we
    *         do the END READ
    *
    OPEN      TAR CUSTOMER        SHARE? Y FAIL 0
    END READ  TAR CUSTOMER 
 
No CLOSE statement is needed - APPX simply switches the internal data structures between databases with each OPEN statement. This turns out to be much faster than the SPEED II method which required physically closing the file and reopening it for each database switch. Of course you have more files open with the APPX method.

When APPX needs to open a file, it does so in two phases... a logical open and a physical open. The logical open takes place when APPX opens the file automatically OR when you open the file with an OPEN statement - this phase sets up internal memory structures to keep track of the file - the structure files are also verified during the logical open (this is expensive).

The physical open only takes place when you actually do the first I/O to the file (a read, write, etc.).

A file name (use "CUSTOMER" as an example) actually acts as a file multiplexor - you can get to multiple CUSTOMER files using the same file name. You do this by setting --- NEXT DATABASE and executing an OPEN statement to open a CUSTOMER file in a different database.

[Append to This Answer]
2004-Mar-02 9:22am
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
How to display detailed data from a scrolling input.
I have a scrolling INPUT on a set of data. I would like the Automatic Child to jump to a full screen display of the full set of data. I have an existing INQUIRY that has the exact look and feel of what I want, and the users are familiar with this screen. How can I reuse this existing INQUIRY? (A simple Automatic Child doesn't work.)
Before invoking the INQUIRY, set --- PROCESS CODE to "DISP". In the Key Entry frame's Global Pre-Display event point, execute:

      *
      *         RETURN to Display, 1st time thru
      *
      IF       --- PROCESS CODE               EQ     DISP
      T SET --- OPTION = RETURN
      T SET --- PROCESS CODE = DONE
      *
      *         END to go back to INPUT, 2nd time thru
      *
      F IF --- PROCESS CODE EQ DONE
      FT SET --- OPTION = END 

(All this can be done in a SUBR, called from Key Entry's Global Pre-Display event point.)

When the INQUIRY starts, PROCESS CODE is DISP, so the KEY ENTRY frame is skipped. Since the INQUIRY is constrained to one record, it displays only that record from the INPUT.

When the user presses ENTER or END after viewing the data, Key Entry executes again, but since PROCESS CODE is now DONE, it sets OPTION to END. INQUIRY ends, and control is returned to the parent.

[Append to This Answer]
2004-Mar-02 9:24am
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
How to read EXCEL files from Appx.
Please refer to;

http://www.appx.com/assets/asp/dynamic_generator.asp?pageid=785

[Append to This Answer]
2004-Mar-02 9:26am
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
How do I search the electronic APPX manual(s) for multiple keywords?
On the Search tab in the search text box, ‘Type in the keyword to find:’, use AND between the keywords. Example, “menu AND job AND input” would return topic pages that contain menu, job, and input. Likewise, typing “cnv AND text”, returns the occurrences of the CNV TEXT command.
[Append to This Answer]
2005-Jun-02 11:13am
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
The underline character is not displayed under the shortcut letter!
There is a setting on the desktop that controls whether the underline character appears when the Alt key is pressed (default for Windows XP) or if the underline character should always be displayed. Right click on the desktop, Properties > Appearance Tab > Effects > uncheck Hide underline letters for keyboard navigation until I press the Alt key. The underline character should now be displayed under your shortcut letter(s).
[Append to This Answer]
2004-May-18 3:45pm
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
How to get printer friendly pages from the APPX web site.
On every page there is a little icon of a printer at the top/right corner. Click this to get a printable version of the page.
[Append to This Answer]
2004-Jul-09 4:43pm
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
How do you run an os command and pipe the results through a stream read?
   SET      --- STREAM OPEN TYPE           =      r
   SET      --- TEMP 256                   =      |ls -la /usr1/appx/
   APPEND   --- TEMP 256                   0      data/C01/AGP/Files/
   APPEND   --- TEMP 256                   0  AGP FILES NAME
   SET      --- STREAM FILE PATHNAME       =  --- TEMP 256
   GOSUB    --- STREAM OPEN
   IF       --- STREAM RETURN CODE         NE     0
T  ERROR    Cannot Get File Listing
T  END
   *    
   SET      --- STREAM EOR SEQUENCE        =      LF
   GOSUB    --- STREAM READ
   *        The results will be in --- STREAM BUFFER         
   DISPLAY  --- STREAM BUFFER              (AT APPEARANCE #    )
  Don't forget to close, GOSUB    --- STREAM CLOSE
[Append to This Answer]
2009-Mar-19 2:00pm
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
Now that I can generate PDF files from APPX, how can I get the PDF to display as such in a browser?
Changing the content type tag in the script to "application/pdf" which is the content type for pdf documents.
[Append to This Answer]
2004-Jul-09 5:36pm
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
What is the correct Date Mask for: Apr 13 09:23:00 2004?
Mon Jan 05, 0807 Would result in the date displayed as Tue Apr 13, 2004
[Append to This Answer]
2004-Jul-09 5:37pm
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
Can Current Release of Appx support LDAP?
That depends on platform. Windows and Linux - yes.
Appx can make use of LDAP (since Appx is a language and you can call LDAP functions/executables with CALL and RUN statements). We also use LDAP for authentication if the server's operating system is configured to use LDAP.
[Append to This Answer]
2005-Mar-09 4:14pm
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
How does LOCAL and RECEIVE statements work?
First: a LOCAL statement is (nearly) equivalent to a RECEIVE statement that executes without a matching PASS statement (the RECEIVE statement will set the next T/F to F, but a LOCAL statement doesn't change the T/F flags).
Second: when you execute a LOCAL (or RECEIVE) statement, the engine has to decide the point in time that the original value should be restored.
If you execute a LOCAL (or RECEIVE) while there is a GOSUB active (in the current event point), the original value is restored when you execute a RETURN statement.
If there is no GOSUB active, the original value is restored when the event point ends (with one exception). That means that you can add LOCAL statements to the beginning of an event point to protect variables that you want to use in that event point. You could instead add a RECEIVE statement, but that would be kind of weird (that may let you PASS a value in one event point and RECEIVE it in the next event point, but I can't recommend doing that).
If you execute a LOCAL statement (and there is no active GOSUB) in the StartOfProcess event point, you are protecting a variable for the life of the process (the original value is restored when the process ends).
[Append to This Answer]
2005-Jan-27 3:46pm
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
Can i have environment variable APPX_41_EPS set while designing in 4.2?
No, you can't. APPX_41_EPS variable is a temporary, run time environment variable only. This variable was designed to give you a temporary Appx 41 behavior capabilities, while you are working on bringing your applications up to 4.2 capabilities.
[Append to This Answer]
2005-Apr-13 1:47pm
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
I noticed that all of a sudden i have Applications tab on my Java client. How did it get there and how to get rid of it?
Application tab and menu gets generated by Direct Process 1 or Direct Process 2. You can get rid of Direct Process 1 and/or Direct Process 2 and it will get rid of the Applications tab for you.
[Append to This Answer]
2005-Apr-13 4:02pm
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
I have set my --- OPTION = END PARAGRAPH, but it doesn't seem to do anything. Why is that?
END PARAGRAPH is listed as a valid value for --- OPTION, but setting this value into OPTION doesn't seem to do anything. Also, the END PARAGRAPH keystroke does not trigger the Option Intercept Event Point, so the designer can't test for this.


Options whose numeric values are >= 20000 are handled by the client and never make it to the engine (things like TAB, CURSOR UP, END PARAGRAPH, ...). But, you can assign any of those tokens to WIDGET OPTION, WIDGET OPTION FOC G, or WIDGET OPTION FOC L.

[Append to This Answer]
2005-Apr-14 8:59am
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
I am trying to PASTE a statement into the ILF editor, but it put "**" in the front of it and it looks miss-aligned. What did i do wrong?
When you PASTE a block of statements into the ILF editor, Appx tries to convert each line of text in the clipboard into a valid ILF statement. If it can't, it converts the offending text into a comment.
So, Appx doesn't like *something* about the statement you're trying to paste. The most likely problem is that the alignment of the fields is wrong (you have a space where you shouldn't have one or you don't have a space where you need one).
If you've copied the IF DIFF statement from another event point, that's not likely to be the problem. Instead, it may be that the operands won't convert properly in the context that you're pasting in to.
Next time it fails, you might try pasting into an empty subroutine just to see if that work.
[Append to This Answer]
2005-Apr-19 3:31pm
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
Is there a way to get rid of the automatic drop down menus that appear on my GUI menus processes?
I think that you'll find (most of) the automatic menus and toolbar buttons in the --- WIDGET file. If you don't want them to show up, just delete them from --- WIDGET in the Pre-Display event point (or disable them if you want to see them but you don't want them to do anything). If you want a more pervasive solution, you can hook the --- STANDARD TOOLBARS input process.
[Append to This Answer]
2005-Jun-02 11:09am
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
Is there a way to get rid of the big red X (Cancel) and the green arrow (Return)?
I think that you'll find (most of) the automatic menus and toolbar buttons in the --- WIDGET file. If you don't want them to show up, just delete them from --- WIDGET in the Pre-Display event point (or disable them if you want to see them but you don't want them to do anything). If you want a more pervasive solution, you can hook the --- STANDARD TOOLBARS input process.
[Append to This Answer]
2005-Jun-02 11:10am
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
Is there a way to set child constraints on a data lookup field in an Input Process?
You can constrain the scan list by creating a cached version of the file you want to do the data lookup on an populating it with only the records that meet your criteria. Create the cached file with NOLOAD, then once you have a PCF record use a begin at/end at contraint to read the records from the disk file and write them to the cached file. You will have to OPEN each instance of the file before the reads and writes. Something like this:
 SCRATCH APP FILENAME FAIL 0 CACHE? Y
 CREATE APP FILENAME SHARE? Y FAIL 0 CACHE NOLOAD
 OPEN APP FILENAME SHARE? Y FAIL 0 CACHE? N (for disk version)
Then to populate:
BEG AT APP FILENAME IN some constraint END AT APP FILENAME IN some constraint BEG READ APP FILENAME HOLD 0 KEY IS FILENAME KEY FIELD OPEN APP FILENAME SHARE? Y FAIL 0 CACHE? Y (for cached version) WRITE APP FILENAME OPEN APP FILENAME SHARE? Y FAIL 0 CACHE? N (for disk version) END READ APP FILENAME OPEN APP FILENAME SHARE? Y FAIL 0 CACHE? Y (so process will use cached version)
Now the data lookup should work on the cached file.
You could also build a memory file and do the same thing and have the data lookup work on the memory file.

[Append to This Answer]
2005-Jul-06 8:36am
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
How can I wait on Windows-systems without consuming CPU?
You might want to try "sleep" command. You can put the command into a .bat file and execute it from Appx with /w. Here is link for a free download of a resource kit tool for Windows 2003 that contains sleep.exe command: http://www.microsoft.com/downloads/details.aspx?FamilyID=9d467a69-57ff-4ae7-96ee-b18c4790cffd&displaylang=en
Or you can take an approach as outlined there:
http://www.appx.com/assets/asp/dynamic_generator.asp?pageid=161


[Append to This Answer]
2005-Jul-29 4:40pm
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
I am using a --- STREAM WRITE call on a file that is > 2GB. It doesn't crash or return an error code, but it doesn't write to a file either
The STREAM WRITE subroutine uses the standard fputs() function (part of the C Runtime Library). That function is limited to files smaller than 2GB in size. If you want to write to a larger file, you'll have to use a different API (that means that you'll have to write a C routine and CALL that routine instead of using STREAM WRITE).
[Append to This Answer]
2005-Aug-29 8:53am
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
When I execute SLEEP command from an Appx CALL i get the error 'You've CALL'ed C:\WINDOWS\SYSTEM32\kernel32.dll,Sleep with the wrong calling convention'
You need to add a '@' to the end of the subroutine name:

C:\WINDOWS\SYSTEM32\kernel32.dll,Sleep@

That tells Appx to call the Sleep subroutine with the correct calling convention (for some reason, Windows supports a number of different "calling conventions", or rules for calling a function, and most of the kernel32 routines use a non-standard convention - there's no way for Appx to know which convention to use so you have to tell us).

Windows supports two different (and incompatible) "calling conventions" - __stdcall and __cdecl. By default, most applications (including Appx) use the __cdecl calling convention. When you invoke a function that uses the __cdecl calling convention, the caller (that's Appx) pops arguments off the top of the runtime stack when the function ends. When you invoke a function that uses the __stdcall convention, that function cleans its own arguments off of the top of the runtime stack before it returns to the caller. Appx can't tell the difference between __cdecl and __stdcall functions. Appx assumes (unless you tell it otherwise) that you want to call __cdecl functions. If you invoke a __stdcall function (and you don't tell Appx that you're calling a __stdcall function), the runtime stack will be corrupted.
APPX tries to recover from this error but will also display a CASSERT message that tells you that you've CALL'ed a function with the wrong convention (the message includes the name of the function that you've called). If you see that message, add a '@' to the end of the function name (or, if you already have a '@' at the end of the function name, remove it). The '@' is the "windows way" to tell Appx to use the __stdcall convention to call your function. For example, you currently invoke the Kernel32,DeleteFileA - change that to Kernel32,DeleteFile@.
So how can you tell which functions are __stdcall and which functions are __cdecl? That's not an easy question to answer - that information is included with the Microsoft C compiler, but I don't see it anywhere else. That's why I'm displaying the CASSERT message here; so you'll know when you run into a problem. In general, most of the functions that you find in Kernel32.dll will be __stdcall functions (so you need to add an @ to the end of each Kernel32.dll function name).
P.S. If you want to learn more about calling conventions: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclang/html/_core_Calling_Conventions_Topics.asp

[Append to This Answer]
2006-Jan-03 12:00pm
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
How can i set default values during data entry and make Appx remember them from one entry to the next one?
What you are looking for is CTRL+F3 - SET ENTRY ATTRIBUTES option.
The SET ENTRY ATTRIBUTES option,is activated by selecting the CTRL+F3 keys. This option allows you to designate the following four attributes that pertain to input processing:
    *Save as Default allows you to designate whether you want to re-display on 
each subsequent screen, the value that you entered on the prior input process screen. For example, if you are entering customer information and have a number of customers from the same city, you could save yourself keying time by having APPX redisplay the city as you begin to enter each subsequent customer record. You can change the city name if you want, but if it stays the same you do not need to re-enter the value each time.
    
    *Auto Read Next allows you to control which record will be read and 
displayed by APPX after you are done modifying, deleting, or displaying a record. If you select Auto Read Next and complete a change to the record on the screen, the next record automatically displays.
    *Auto Read First allows you to control which record will be read and 
displayed by APPX if you try to call up a record without specifying a key value. If you select Auto Read First, the first record in the file automatically displays.
    *Exact Key Required allows you to specify whether or not a complete key must
be entered when accessing a record from a file. For example, if the specified key path to the CUSTOMER file is CUSTOMER NAME, you can designate whether you must enter the entire name to retrieve a record, or whether APPX will use a partial key value (e.g., the letters “SMI”) to retrieve a record. If you set Exact Key Required to No, entering “SMI” would retrieve the first customer name beginning with these three letters (“SMILEY,” for example). This partial key feature is helpful because it can minimize the number of keystrokes you need to enter.
To set or modify these options, position the cursor on the desired item and select the SET ENTRY ATTRIBUTES option. You see the four SET ENTRY ATTRIBUTES options display on the screen. Note that the Save as Default value applies to the item you positioned the cursor on; the other three values apply to the input process as a whole. Examine the values and change them by clicking on the appropriate checkbox to toggle it from “yes” to “no”.

[Append to This Answer]
2005-Sep-08 2:24pm
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
Copying Files between Databases/Versions
The following example shows how all of the records in the CUSTOMER file in database AAA can be copied to the CUSTOMER file in database BBB:
      *      
      *        Open file in source database      
      *      
      SET      --- NEXT DATABASE              =      AAA      
      OPEN     SPF CUSTOMER  SHARE? Y  FAIL 0 CACHE? N      
      *
      BEG READ SPF CUSTOMER               HOLD 0 KEY IS  CUSTOMER NO
      *
      *        Open file in destination database
      *
      SET      --- NEXT DATABASE              =      BBB
      OPEN     SPF CUSTOMER  SHARE? Y  FAIL 0 CACHE? N
      WRITE    SPF CUSTOMER               FAIL 0
      *
      *        Open file in source database
      *
      SET      --- NEXT DATABASE              =      AAA
      OPEN     SPF CUSTOMER  SHARE? Y  FAIL 0 CACHE? N
      *
      END READ SPF CUSTOMER
When you use the above technique to switch between a file that has been created in two different databases, the two databases MUST be associated with the same application version. In the System Administration file for Databases / Applications, database AAA and database BBB must both identify a startup application with the same Version.
For example, if the Startup Application for database AAA is XXX 01, then the startup application for database BBB must also have a version of "01". The application ID can be different but the version must be the same.

[Append to This Answer]
2005-Oct-07 3:43pm
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
Adding new fileds with defualt values to an existent file
Would APPX place the default value of the new field into every existing record in the file?
We do in fact add the default value to every record when you restructure. The restructure process generates an event point that BEG/END READ's through the old file, SET's the old fields into the new structure, then WRITE's the new record. After each read, we RESTORE DEFAULT RECORD (into the new record) - that assigns the default values to all fields.
But, if you do a quick restructure (that is, you add a field to a variable-record-length file), we don't read copy the records.


[Append to This Answer]
2005-Oct-11 9:59am
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
I have an ALPHA field with a validation table, but it allows for any value to be entered, regardless of the validation table values
You need to make sure, that "Required Table Value" in the Additional attributes of the field is either NULL or Y. If it is set to blank or N, it will allow for any value to be entered.
[Append to This Answer]
2005-Nov-11 3:03pm
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
What is the proper usage of --- STREAM READ LENGTH field?
I have a job that takes a tab-delimited file and reformats it to an appxio file. The STREAM READ only returns a valid record the first time, subsequent reads return varying data.
My simple subroutine looks like this:
     SET      --- STREAM OPEN TYPE           =      r
     SET      --- STREAM READ LENGTH         =
     GOSUB    --- STREAM OPEN
     SET      --- STREAM EOR SEQUENCE        =      LF
     IF       --- STREAM RETURN CODE         NE     0
     *
     *        read tab file record
     LABEL    :NEXT RECORD
     TRAP
     GOSUB    --- STREAM READ
     IF       --- STREAM RETURN CODE         EQ     0
     IF       --- STREAM BUFFER              EQ
     GOTO     :NEXT RECORD 

The field --- STREAM READ LENGTH is used for two things. If set to a value other than zero the READ subroutine will limit the data bytes it reads to no more than that many bytes. What gets you is that your READ routine also uses that field to tell you how many bytes it actually did read. So, the first time you call it the value was zero, it read in number of bytes (if you count the tab bytes) up to the linefeed and set that number of bytes into this field. Since you didn't reset it to zero that value carried forward to the next read. It read that number of bytes and stopped leaving the rest<lf> unread. The next time you called read it read the remaining number of bytes up to the linefeed and set the length to that number. And so on.....
So, you need to set this field to zero before each read attempt.

[Append to This Answer]
2006-Jan-18 8:57am
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
Can the STREAM READ look for the presence of the \r character as a record delimeter?
Or is it limited to looking for the \r\n combination?
It depends on the platform. On Unix/Linux hosts, fgets() looks for \n to terminate each line. On Windows hosts, fgets() looks for \r\n. That follows the standard on each platform.
When you set the line terminator in Appx, that doesn't affect fgets(), it just tells Appx which characters you want stripped from the end of the string. If you set the line terminator to NONE, Appx just calls fgets() and gives you whatever fgets() returns. If you set the line terminator to LF or CR\LF, Appx will strip those characters from the end of the string (if present).
We've never really made a link between STREAM READ and the format of an Appx print file (in other words, we don't produce print files using the --- STREAM functions). STREAM READ will simply treat the form-feed character as just another character. If you want to treat a form-feed as a line delimiter, you can always search for a form-feed in the buffer (a simple IF statement will find any form-feeds and TEXT AT POSITION will tell you where it appears).
Or, you can use any other C runtime function (or OS-provided function) to read any file that you like. STREAM READ is just a convenient wrapper around the fgets() C runtime function.
[Append to This Answer]
2006-Feb-08 8:41am
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
The --- COMPARE file contains the fields that are different after an IF DIFF is executed. If a field has multiple occurances, how can I tell which occurance changed?
You really can't tell which occurance changed, because --- COMPARE doesn't support multiple occurances and --- COMPARE FIELD NAME is a primary key to the file.
[Append to This Answer]
2006-Apr-20 3:12pm
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
How to create a PDF Form Overlay
Please refer to the Output Processes for complete instructions on using this technique. http://board.appx.com/faq/cache/639.html
[Append to This Answer]
2007-Jan-24 4:05pm
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
How to create an ASCII fixed length flat file using Appx
Create a consecutive file in your application with the necessary fields. All fields must be type Alpha. If needed, add a two character field for carriage return/line (last field).

Create an update process and simply SET, or CNV TEXT, fields from your source file (PCF) into the alpha fields of the consecutive file. The actual Appx file (filename.dat) in the database Data directory will contain the ASCII text file. You might consider renaming it to filename.txt before using or sending the file to someone else.

The carriage return/line feed characters can be added as follows;

     In Start of Process…
         CNV BIN --- CDF HEX00                    =  0
         CNV BIN --- CDF HEX0A                   =  10

     In Start if Frame…
         APPEND  --- TEMP 2                            0  --- CDF HEX0A    
         APPEND  --- TEMP 2                            0  --- CDF HEX00
Numeric and Date fields must be converted to text using the CNV TEXT command. Other formatting may need to be performed depending on your particular specifications.

Don’t forget to WRITE the records to the consecutive file. Also, you must SCRATCH and CREATE the flat file on each execution of the Update process. If the file is not scratched, data will be appended to the end of the file.

[Append to This Answer]
2007-Jan-31 1:22pm
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
Execution Cycle in Appx 4.2
By setting APPX_41_EPS=1 environment variable, you can get previous EP behavior.
This variable, however, can not be set for design. It is for Run time only.

Execution cycle in 4.2 has been changed in 3 areas:
1.      Input execution after OC
2.      Input execution on Delete
3.      Input execution auto execution of child process.


On #1 – input Execution after OC – if you have ORDER1 Input Process, and execute opt1 to run Line Items process, we changed execution cycle when you come back from a child.
The order of the events as follows:
1.      Read the PCF record with HOLD
2.      Executes Post PCF Read
3.      Executes Post Invocation of the Child
4.      Executes Select Image
5.      Executes Pre-Display/Verify EP
6.      Executes Pre-Display
7.      We display the Screen

4 – 6 – is what changed in 4.2.

On #2 – Input Execution on Delete – if you delete a record, Appx will execute Pre-Update EP, after Delete – Post_PCF Update EP.
Prior to 4.2 – Pre-PCF Update Ep wasn’t executing.

On#3  Input Execution auto execution of child process – Key change, record delete (for example, you have ORDER1 and ORDER2 as an AC to ORDER1. If you delete ORDER1 record, you need to delete all corresponding ORDER2 records).
It looks to see if ORDER2 needs to be run.
It executes ORDER2 in autoexecute, it goes through all the steps to delete ORDER2 records.

It executes:
Post PCF read
Pre PCF Update
Post PCF Read
Delete – Post PCF Update

It will execute all these EP’s for each line item.

In 4.1, it wasn’t executing Post PCF Read and Pre PCF Update.
[Append to This Answer]
2007-Mar-15 4:11pm
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
Under what circumstances you need to set NLS_LENGTH_SEMANTICS
First a short introduction on the choice of character set and length semantics: 
Using Unicode as a character set will allow you to store any character, 
not just the western European characters you are normally limited to.

Unicode is a multi-byte character set which means that a single character could use more than a single byte. So what do you mean by VARCHAR2(10)? 
Is this 10 characters or 10 bytes? 
This used to be the same with our single byte character set, but with UTF8 this is no longer true. 
You can specify VARCHAR2(10 BYTE) or VARCHAR2(10 CHAR) if you want to be specific. 

However, APPX doesn’t use this syntax and does not specify either. 
This is where the NLS_LENGTH_SEMANTICS parameter comes in. 
You can set this to BYTE or CHAR basically defining which one of the two is the default when not specifying it explicitly.
 
A default Oracle installation will use BYTE semantics which will work with APPX.  
However, if the default is changed to CHAR semantics, then APPX won't work without setting the following environment variable:

NLS_LENGTH_SEMANTICS=BYTE
[Append to This Answer]
2008-May-13 2:55pm
Next: (Category) ILF (Integrated Language Facility)
This document is: http://board.appx.com/cgi-bin/fom.cgi?file=20
[Search] [Appearance] [Show Top Category Only]
This is a Faq-O-Matic 2.719.
Copyright 2003 by APPX Software, Inc. All rights reserved.