PN5_50535


Patch Number

Ticket Number

Change type

5_50535

792993 775292

Patch

1. Description

General fixes for Case Independence, notably the default action handling.

2. Previous Release Behavior

The main issue was that the jBC CASING statement affected the parent process.

3. Current Release Behavior

This change alters the behavior of whether casing is sensitive or insensitive. As a summary:

Assuming D3 emulation...

When a new program starts on a new port (i.e. we have just consumed a license), then casing will be insensitive, e.g.

("ABC" EQ "abc") == TRUE

All future programs loaded on that port will also begin with casing insensitive. This is irrespective of what casing their parent program has. The way to change this default behavior for new programs is the CASE program

jsh gregc ~ -->CASE ON
CASE Sensitive
jsh gregc ~ -->CASE (N)
CASE Sensitive

In both these cases, it means that any future programs that are started on this port will now have case sensitivity for string comparisons.

The CASE command only affects new programs for this port. It does not affect any existing running programs, nor does it affect any programs other than the port it is run on.

Once a program starts under D3 emulation it will usually have case insensitivity as its default, unless the CASE command has been run as shown above. You can change the case sensitivity for the running program using the CASING statement as shown below. Note that the CASING statement only affects the current program it is run from, it does not affect the parent (calling) program, and it does not affect any programs it starts with PERFORM or EXECUTE.

IF ("ABC" EQ "abc") THEN PRINT "CASING IS INSENSTIVE" ELSE PRINT "CASE SENSITIVE"
CASING ON
IF ("ABC" EQ "abc") THEN PRINT "CASING IS INSENSTIVE" ELSE PRINT "CASE SENSITIVE"
CASING OFF
IF ("ABC" EQ "abc") THEN PRINT "CASING IS INSENSTIVE" ELSE PRINT "CASE SENSITIVE"

CASING IS INSENSTIVE
CASE SENSITIVE
CASING IS INSENSTIVE

The jBASE build has been amended to cater for case sensitivity. All the jBASE programs were written assuming case sensitivity. Therefore there have been problems with a number of programs running in D3 emulation as the case insensitivity has caused issues. So for most of the programs we now do a jBASE build using jcompile -g filename ...<options>. The -g option is new to the jcompile command. This forces a CASE ON statement to be executed as the first line of a jBC command. Hence for programs like BASIC (which have proved problematic).

The CASE program has had its command line changed slightly to bring it more in line with D3. The HELP screen now shows the modified CASE program syntax:

jsh gregc ~/tmp -->CASE HELP
CASE Insensitive

  CASE: Sets options for Case Sensitivity, enables or disables all emulated behavior for strings:

  case {(options}

  Options:
    Prefix options with [(] for backward compatibility:
      f - Turn OFF case sensitivity
      n - Turn ON case sensitivity
      s - Suppresses output of the status message
      h - This page
          e.g.  case (fs  [off and dont display the status]

    No prefix:
      ON       - Turn ON case sensitivity
      OFF      - Turn OFF case sensitivity
      <<NULL>> - show status
      HELP     - This page

  NOTE: jBASE is Case Sensitive by default.