In order for this site to work correctly, and for us to improve the site, we need to store a small file (called a cookie) on your computer.
By continuing to use this website, you agree to our cookies and privacy policy.
  
Home page Home page Home page Home page
Pixel
Pixel Header R1 C1 Pixel
Pixel Header R2 C1 Pixel
Pixel Header R3 C1 Pixel
Pixel

Reader's Clinic - LCEdit and SCRIBE

Charles Sherbow recently asked "When you edit a DOS table normally it is all on one line. Then you press Shift+F7 and the table is vertical in nature. When you leave the table and come back it is still in the state that you left it. How do you check to see if a table is in the "vertical" or "horizontal" mode? Where are the variables?"

Scattered throughout memory are a number of labelled common areas maintained by the system for things such as indexing and editing. One of these is called LCEDIT and takes five parameters as follows

     /LCEdit/ LastPopupRow, Unknown, EditCount, RowsEdited, ScribeState

LastPopupRow   The row of the editor softkeys popup last selected.

     Unknown   As yet unknown.

   EditCount   How many copies of the editor have been called currently
              (equal to the number of times EDIT occurs on the return stack.
              Note that this is not how many times EDIT appears on the
              program stack, it is loaded only once).

  RowsEdited   A field mark delimited array identifying the rows which have
               been edited, in the format Table*Row, E.G. VOC*LISTTABLES.

 ScribeState   A Char(247) delimited array of information about each of the
               editing sessions identified in RowsEdited. Within each
               element, individual characteristics are delimited by @RMs.
               The array values are as follows (Using <> to indicate @RMs
               not @Fms)

               < 1 >     Apparently unused.
               < 2 >     A flag indicating whether the delimiter being used
                         for editing is a field mark or record mark (0 or
                         null), or Carriage Return/Line Feed (1).
               < 3 >     Row position of the line at the top of the current
                         screen.
               < 4 >     Row position of the cursor.
               < 5 >     Column position of the character at the start of
                         the current line.
               < 6 >     Column position of the cursor.
               < 7 >     A flag indicating whether the cursor is in
                         destructive (0) or non-destructive mode (1).
               < 8 >     A flag indicating whether Insert (1) or Overwrite
                        (0) is enabled.
               < 9 >     String last searched for with a Ctrl-F/Ctrl-R.
               < 10 >    Replacement string for Ctrl-R.
               < 11 >    Apparently unused.
               < 12 >    Row position at start of block.
               < 13 >    Row position at end of block.

Thus to answer Charles' query one could use a code segment such as :


0001    Common  /LCEdit/ LastPopupRow, Unknown, EditCount, RowsEdited, ScribeState
0002    Locate Table:"*":Row In RowsEdited Using @Fm Setting Pos Then
0003      RowInfo = Field(ScribeState, Char(247), Pos)
0004      RowIsDosFmt = Field(RowInfo, @Rm, 2)
0005      If RowIsDosFmt Then Call Msg("Yup") Else Call Msg("Nope")
0006    End Else
0007      Print Char(7) :
0008    End

(Volume 4, Issue 6, Pages 4,5)
Pixel
Pixel Footer R1 C1 Pixel
Pixel
Pixel
Pixel