WebFormReset Function

Action

Resets a Web form as declared in the dclform section. This function can be used to undo all dynamically made modifications.

Include file

WebAPI.bdh

Syntax

WebFormReset( inout fForm: form ): boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
fForm Web form whose content will be reset

Example

dcltrans
  transaction TMain
  var
    sFirstName, sLastName, sPhone: string;
  begin
    WebFormValuePairInsert(fForm, "street", "Beach Road");
    WebFormValuePairInsert(fForm, "phone", "1212-555-8532");
    WebFormValueSet(fForm, "last name", "Smith");
    WebFormValueGet(fForm, sFirstName, sizeof(sFirstName), "first name");
    WebFormValueGet(fForm, sLastName, sizeof(sLastName), "last name");
    WebFormValueGet(fForm, sPhone, sizeof(sPhone), "phone");
    write("first name = "); write(sFirstName); writeln;
    write("last name = "); write(sLastName); writeln;
    write("phone = "); write(sPhone); writeln;

    WebFormReset(fForm);

    WebFormValueGet(fForm, sFirstName, sizeof(sFirstName), "first name");
    WebFormValueGet(fForm, sLastName, sizeof(sLastName), "last name");
    WebFormValueGet(fForm, sPhone, sizeof(sPhone), "phone");
    write("first name = "); write(sFirstName); writeln;
    write("last name = "); write(sLastName); writeln;
    write("phone = "); write(sPhone); writeln;
  end TMain;

dclform
  fForm:
    "first name" := "Peter",
    "last name"  := "Heart";