<<

Contents

Search

>>

 

SELEDIT$

 

 

Function

 

 

Syntax:

SELEDIT$(<Field of Index File>[,<Handle>])

 

<Field of Index File>

= <INDEX FILE FIELD>

<Handle>

= <NUM-EXPRESSION>

 

Meaning:

Edits a field in SELECT.

 

Only fields of the Index File specified with SELECT can be edited, auxiliary fields or fields of other Index Files cannot be edited. The <Field of Index File> must appear as <Select Field> in the SELECT.

 

<Handle> specifies in which window SELECT is running. <Handle> can contain the window depth or the handle of a split window or a WINDOWCALL window. If the parameter <Handle> is missing, SELECT has to run  in the current window.

 

SELEDIT$ returns the key by which field editing has been terminated. The empty string as result means that an error occurred.

 

Note: SELEDIT$ does not write data into the Index File but only allows the editing of the field on screen. The respective data record must be rewritten in the Macro afterwards. Before SELEDIT$ is called the instruction READSELECT must be executed in the ON SELECT(...) Macro so that the current data record is read.

 

If the function SELDIT$ returns the value <> "", the changed field value is in the respective Index File variable.

 

Note: While a field is edited the current ON <Taste> Macros apply and not the ON SELECT(<Taste>) Macros!

 

Parameter:

Field of Index File

Name of field of Index File

 

Handle

Window depth or handle of a split window or handle of a WINDOWCALL Window

 

Sample:

/* Pressing <RETURN> the field CUSTOMER.NAME$ shall be edited.

/* Scrolling shall be possible by <PGDN> and <PGUP>.

/* <RETURN>, <↓> and <→|> go to the next line.

/* ­<↑> and <|←> go to the previous line.

/* <Esc> aborts.

 

ON SELECT(RETURN) MACRO EDIT

 

H% = SELECT(CUSTOMER,0,0,"Change Customer Name","",0,"",

            NUMBER,,NAME$,,ZIP,,CITY$)

...

 

Macro EDIT:

 

READSELECT ON ERROR ... Error ... END

R$ = SELEDIT$(CUSTOMER.NAME$) /* Edit field

IF R$ <> "" AND R$ <> ESC$    /* Rewrite data record

THEN WRITE KUNDEN ON ERROR ... Error ... END

     /* By UNGETCHAR RETURN$ the ON SELECT(RETURN) Macro

     /* is started again

     CASE R$

       OF CURSUP$    UNGETCHAR CURSUP$ + RETURN$ /* 1 line up

       OF TABLEFT$   UNGETCHAR CURSUP$ + RETURN$ /* 1 line up

       OF CURSDN$    UNGETCHAR CURSDN$ + RETURN$ /* 1 line down

       OF $TABRIGHT$ UNGETCHAR CURSDN$ + RETURN$ /* 1 line down

       OF RETURN$    UNGETCHAR CURSDN$ + RETURN$ /* 1 line down

       OF PGDN$      H$ = "" /* 10 lines down

                     FOR I%=1 TO 10

                         H$ = H$ + CURSDN$

                     ENDLOOP

                     UNGETCHAR H$ + RETURN$

       OF PGUP$      H$ = "" /* 10 lines up

                     FOR I%=1 TO 10

                         H$ = H$ + CURSUP$

                     ENDLOOP

                     UNGETCHAR H$ + RETURN$

     ENDCASE

ENDIF

 

See also:

SELECT

SELAEDIT

SET_SELAEDIT_VALUE