Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Help - isNumeric, isEmpty var return

$
0
0

I am no VBScript expert in anyway and I am trying to take a vale from a MySQL DB field that is a semicolon delimited list of varying strings and use it for calculation.  Here is the variable assignment: 

dim profile
profile  = split(rec("profile").value & ";;;;;;;;;;;;;;;;;;;", ";")
for i = 0 to 19
  if profile(i)  = "" then recTpl.removeBlock "Profile" & (i+1)
  recTpl.assignVariable "Profile"  & (i+ 1), profile(i)
next

I am then trying to take the 19th variable (Profile19) which contains either a numeric value or is empty and use it for calculation, however, no matter what type of function I use to test the contents, I am left with a default value of one as this is to catch the instances where this variable is empty.  Can anyone assist/explain why the value is not coming through?  I have gone through this with a bunch of other programmers but none of us are VBScript experts....   Thank you!!!!!

if Not isEmpty(Profile19) then 
  if isNumeric(Profile19) then
    ASSIGN THE VARIABLE I AM TRYING TO PERFORM CALC
  else if Not isNmeric(Profile19) then
    VAR = CInt(Profile19) 
  end if 
else if isEmpty(Profile19) then 
  ASSIGN THE VARIABLE I AM TRYING TO PERFORM CALC = 1 
end if 


Viewing all articles
Browse latest Browse all 15028

Trending Articles



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