Home API Manuals About Forum
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

GetShopList

Retuns last shop list as strings. Format of result lines is “’№: ‘Number’|ID:|$’ID’|type|$’Type’|Color|$’Color’|Name|’Name’|Price|’Price’|Cliloc|’+Tooltip+_|Quantity|’Quantity”, where ID, Type and Color values in hex (with $ prefix).

Warning: param (with type TStringList) should be created before calling GetContextMenu and be disposed after use!

NB: DWS have overloaded method version, which returns array of string and dont need any init before.

Example of return:

"№: 0|ID:|$4001D0B7|type|$2BE3|Color|$0000|Name|Fresh Ginger|Price|505|Cliloc||Quantity|10"
"№: 1|ID:|$4001D0B8|type|$103B|Color|$0000|Name|bread loaf|Price|6|Cliloc||Quantity|20"
"№: 2|ID:|$4001D0B9|type|$103C|Color|$0000|Name|bread loaf|Price|5|Cliloc||Quantity|20"
...
"№: 11|ID:|$4001D3DC|type|$0A1E|Color|$0000|Name|bowl of flour|Price|7|Cliloc||Quantity|20"

Pascal Script:

procedure GetShopList(var List : TStringList);  

DWS:

function GetShopList : TArray<String>;
procedure GetShopList(var List : TStringList);  

Example:

var   TL : TStringList;
       Ca : Cardinal;    
begin
  {$IFDEF DWSCRIPT}
  AddToSystemJournal(GetShopList);
  {$ELSE}  //Pascal Script
  TL := TStringList.Create;
  GetShopList(TL);
  if TL.Count > 0 then
    for Ca := 0 to TL.Count - 1 do
      AddToSystemJournal(TL.Strings[Ca]);  
  TL.Free;
{$ENDIF}
  UOSay('vendor buy');
//or conext menu item selection...
end;

Python Syntax:

def GetShopList(): --> array of string