The ModScript docs for the Dictionary object say:
A class for supporting dictionary objects in scripts that are converted from SBM AppScript to SBM ModScript. A dictionary is a case sensitive key-value container. In general, use ChaiScript's Map…
I'd like to have a ModScript "string" constructor that will handle a VBScript String like this:
var str_PostData1 = string(Shell.PostData());
For the time being I'm doing this, but I'd like to learn how to do write my own constructors. ModScript needs…
I attempted to solve this through tech support but failed.
Lines 4 and 5 reassign the variable "mymap_pair2". Why does this fail? Lines 11 and 12 attempt to add a Map_Pair object to a Map. According to the documentation this should be a valid operation…
Hi! I'm trying to implement in-place mergesort in ModScript. For this, I want to pass a vector by reference, but the validator fails. What am I missing?
def merge( Vector& v, int l, int m, int r) {
if (l == r) {
return;
}
var vecL = [];…
What file extension are you using for ModScript (i.e. Chaiscript) files?
I'm currently using ".chai". For AppScript I started using ".tsc" (i.e. "TeamScript") many years ago, along with ".tsl" for "Teamscript Library" files which are libraries of…
There are functions like UpdateBlobFromFile() Method and AppDB WriteBlobToFile() Method to store file data into an existing BLOB.
The question is: Can I create a new BLOB entry in TS_BLOBS and use the same for file data:
var blobRec = Ext.CreateAppRecord…
It should be fairly simple. You would use a combination of using get attachment from database my screen function to get the file from SPM and then once it's written on the local file folder, then you could run any version manager command line function…
Hi, I am planning to write a Modscript that will make a REST call to a rest endpoint using the RESTDataSource Get() method. The endpoint is suppose to return a content-type of Image/png which is binary response. My questions are 1. Do we have a data type…
For the ReadDynaSQL function, what are the (2nd param) DBTypeConstants constants for the following field types:
VarChar(255) (schema says DATA_TYPE=-9; nvarchar; LENGTH=1020)
VarChar(max) (schema says DATA_TYPE=-10; ntext; LENGTH=2147483646)
The…
Hello All,
I'm wondering if there is a way to define a method that accepts an optional parameter?
myfunction( var1, var2, var3);
myfunction( var1, var2, var3, var4);
def myfunction( var1, var2, var3, var4){
//Do Stuff.
}
-Thanks…
When a module defines variables with:
var x1 = int(1);
var v1 = Variant(1);
and that module includes another module, are the definitions "x1" and "v1" visible in the included module?
If the included module defines variables:
var x2 = int(2);
…
I would like to do something like this in ModScript with SBM 11.3 ....
for each day in Start_Date to End_Date-1
... do stuff
end
Start_Date and End_Date come from SBM "Date-Only" date/time fields. Reading them returns ISO8601 strings. I can convert…
I'm not sure if this is a problem or intended behavior but I'm pretty sure it's intended behavior. Initially I was thinking that a "try" block was different. Is the fact that "arl2" doesn't exist outside of the "try" block considered "intended behavior…
I'm working on a modscript with a subroutine where I'm pulling in a field value a variant. I'm reusing this variant later for another call to the subroutine, but it seems to be holding on to the original value. How would I go about "resetting" this variant…
Hello,
I wrote a C DLL which will be loaded from a ModScript. This DLL depends on some additional DLLs. The only solution to bring all this to work is to copy all additional DLLs into the system32 folder :(
I tried also the suggested ways from SBM…
Anyone know why the return value for the following fields from TS_USERS are returning the same value even though the database field value is this:
DB Field Value:
[TS_CREATELOGINDATE] 1531180800
[TS_LASTLOGINDATE] 1547164800
objExistingUser.GetfieldValue…
So I compiled ChaiScript and test my code in console before using it in my app since I find the task of having to deploy the app each time in order to test if inconvenient. Is there a way to load the sbm added functions in console for the purpose of testing…
Hello All,
I'm working on an Asset Management workflow in our SBM system and I'm faced with a rather interesting challenge. I need to pull in and display data on a stat forms from two different systems related to this process (Kaseya
The last two days, I tried to learn more on Modscript. Especially I did focus on GetFieldValue
and the newly introduced Variant() data type.
This report is divided into the following sections:
Background
Assignments to variables of type Variant…
In chaiscript I did use "dump_system()" a lot to understand which functions are available for a specific object. Now I also would like to see the output of "dump_system();" for the current SBM release. Unfortunately dump_system() does not return a string…
There are several appscript functions for which a counterpart in Modscript might be useful.
The idea is this: Why not collecting some useful mappings of VBS functions for the SBM Modscript community?
Maybe someone comes across or finds some usefull…
I started to work with Chaiscript/Modscript. I just came accross a strange behavior with the variant data type.
Background: The Variant data type is a new concept, specific to Modscript (not part of Chaiscript). It is used to return values from record…
Digged a bit around the "Brand NEW" Modscript feature and it was a lot of disappointment. Are we really moving from an old "vbScript 4.0" ~1998 with like no online exploitable documentation, no support for object oriented stuff (classes were introduced…
Hi,
I need to convert data fetched from the database into json using the native to_json() function but the function is understandingly throwing exception because it does not know how to convert Variant to json. In other words, how do I convert Variant…