LOADFILE$ function

Purpose:

LOADFILE$ loads a file into a string variable.

Syntax:

RetStr = LOADFILE$(Filename AS STRING)

Return Value:

  • Data type: STRING
    RetStr A string containing the loaded file.

Parameters:

  • Data type: STRING
    FileName The name of the file to be loaded into RetStr.

Remarks:

Be sure to size the string large enough to hold the file. Here is a simple way to do that.

DIM RetStr$ * LOF(FileName$)

Example:

DIM RetStr$ * LOF("MyData.Txt")
RetStr$ = LOADFILE$("MyData.Txt")
PRINT RetStr$

COMBOBOXLOADFILE statement

Purpose:

COMBOBOXLOADFILE loads a text file into a combobox control.

Syntax:

COMBOBOXLOADFILE(hComboBox AS HWND, FileName AS STRING)

Parameters:

  • Data type: HWND
    hComboBox The handle to combobox control into which file will be loaded.
  • Data type: STRING
    FileName The name of the file to be loaded into hComboBox.

EDITLOADFILE statement

Purpose:

EDITLOADFILE quickly and easily loads a text file into a BCX_EDIT control.

Syntax:

EDITLOADFILE(hEdit AS HWND, FileName AS STRING)

Parameters:

  • Data type: HWND
    hEdit The handle to a BCX_EDIT control.
  • Data type: STRING
    FileName The name of the file to be loaded into hEdit.

LISTBOXLOADFILE statement

Purpose:

LISTBOXLOADFILE loads a text file into a BCX_LISTBOX control.

Syntax:

LISTBOXLOADFILE(hListBox AS HWND, _
              Filename AS STRING  _
           [, FileAppend AS BOOL] _
           [, HScrollAdj AS BOOL])

Parameters:

  • Data type: HWND
    hListBox The handle to a BCX_LISTBOX control into which the file will be loaded.
  • Data type: STRING
    FileName hEdit The name of the file to be loaded into hListBox.
  • Data type: BOOL
    FileAppend [OPTIONAL] If this parameter is set to Boolean TRUE, the file being loaded will be appended the file already in hListBox.
  • Data type: BOOL
    HScrollAdj [OPTIONAL] If this parameter is set to Boolean TRUE, the horizontal scroll will auto adjust to the contents of hListBox.