Quantcast
Channel:
Viewing all articles
Browse latest Browse all 43971

Wiki Page: There is a Left and Right method in Silktest but no Mid function. How can I get round this?

$
0
0
  The following function combines the use of the Left and Right methods to create a Mid function that returns X letters from a string starting at Y position. The prototype is string sDataOut=Mid(string sDataIn, integer iStartPos, integer iEndPos, string sDataOut) The function is [-] string Mid(string sDataIn, integer iStart, integer iEnd, string sDataOut) [ ] integer i=0 [ ] string sData="" [ ] [ ] //Check that iStart and iEnd are NOT out of range compared to sData [-] if((iStart len(sDataIn)) || (iEnd len(sDataIn)-(iStart-1))) [ ] sDataOut="NULL" [-] else [ ] sData=Right(sDataIn,len(sDataIn)-(iStart-1)) [ ] sData=Left(sData,iEnd) [ ] sDataOut=sData [ ] return sDataOut The following testcase will act as proof of function: [-] testcase GetMidString() appstate none [ ] string sData="Borland Software" [ ] sMidString="" [ ] sMidString=Mid(sData,4,4,sMidString) [ ] print(sMidString) sMidString will return "land". Old KB# 20730

Viewing all articles
Browse latest Browse all 43971

Trending Articles



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