Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

You can call the frequently performed operations by transferring them to a common public form, and you can make your script shorter and compacter.

Code Block
Set(@AuthorizationCode, "ENTRY") // Assigning the authorization code to use for the address to the variable
CallForm(ListSelectAddress) //  Calling the address selection form
If(@AddressSelectionResult= -1,Goto(BasaDon)) //  Redirecting the script if the wrong result is returned from the form
 
BeginForm(ListSelectAddress) // CommonPublic address selection form
    Set(@AddressSelectionResult, 0) // Resetting result variable
    Address.List("AuthCode='@AuthorizationCode'","",@AddressList)
    If(@AddressList.rowCount<1)
        ShowMessage({"title":"WARNING","message":"No Address Defined","buttons":"OK"},@Option)
        Set(@AddressSelectionResult, -1) // Incorrect result variable
    Else()
        If(@AddressList.rowCount = 1) // If there is only one address, it is assigned directly to the @@Address variable
            Address.Get(@AddressList.rows.1.Id) 
        Else() // If there are more than one address, it is selected from the list
            PopupView(@AddressList.rows,{"mode":"list","title":"Acceptance Address List","fields":["Address|Address Definition|15|L"]},@order)
            Address.Get(@[email protected])
        EndIf()
    EndIf()
    ReturnForm() // Returning to the line that called this form
EndForm()

...