Quantcast
Channel: Adobe Community : All Content - LiveCycle Designer
Viewing all articles
Browse latest Browse all 5571

Substr Function

$
0
0

I have a script that "walks" through all the records in an Access database table to find the largest file ID number. This script has been working correctly. Now I need to add a prefix to all the ID numbers. This requires me to modify my script so it ignores the one character prefix (prefix is either a "T" or a "Y"). I was trying to use the Substr function to accomplish this.

This is the original script that works:

while(!oDB.isEOF()){
 if(xfa.record.DataConnection1.FileName.value > nMaxID)  nMaxID = Number(xfa.record.DataConnection1.FileName.value);
 oDB.next();
}

 

Below is how I tried to modify the script above to ignore the prefix but I get an error that says Substr is not defined. What have I got wrong?

while(!oDB.isEOF()){
 if(xfa.record.DataConnection1.FileName.value > nMaxID)  nMaxID = Number(Substr(xfa.record.DataConnection1.FileName.value,2,12);
 oDB.next();
}

Viewing all articles
Browse latest Browse all 5571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>