fngb__put_code - Insert Chunks of Code or Data into a .gbf String

Syntax

def fngb__put_code(gb__win_id$,gb__ctl_id$,gb__event_code$,
gb__gbf_data$,gb__sub_name$,gb__sub_code$)

Description

This function is used to insert the following into a .gbf file:

  • Single event handler routines.

  • Special routines.

  • User-defined subroutines/functions.

  • [Program] variable/value lines.

  • To Insert

    Use

    Notes

    Single event handler routine in the .gbf file

    n = fngb__put_code
    ("win-id","ctl-id",
    "event-code",
    gb__gbf_data$,
    sub_name$,sub_code$)

    If sub_name$="", it will be formatted as follows:

    gb__sub_name$="W"+gb__win_id$;
    if num(gb__ctl_id$) then
    gb__sub_name$=gb__sub_name$+"_C"+gb__ctl_id$;
    gb__sub_name$=gb__sub_name$+"_"+fngb__get_event_label$(gb__event_code$)

    n = 1 if the routine was added, 0 if updated.

    All "." in gb__sub_name$ will be converted to "_".

    This is to handle child window IDs in gb__win_id$; they can be formatted like "1.10", "1.10.10", etc.

    Special routine (Init, EOJ) into the .gbf file

    n = fngb__put_code("",

    "Init","",gb__gbf_data$,
    "",sub_code$) 

    n = 1 if the routine was added, 0 if updated.

    User-defined subroutine or function into the .gbf file

    n = fngb__put_code("",
    "Function","",gb__gbf_data$,
    "func-name",sub_code$)

    n = 1 if the routine was added, 0 if updated.

    [Program] variable/value line into the .gbf file

    n = fngb__put_code("",
    "Program","",gb__gbf_data$,
    "var-name","var-value")

    n = 1 if the variable was added, 0 if updated.