Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
function returning some numeric value instead of string
#1
I have written a function where I want to get return value selected in XLS

function# XlsValue str&FileName str&WorkSheet str&ColName str&ExpLanguage
ExcelSheet Excelsheet.Init("" 8 FileName)
Excel.Application XLSapp=Excelsheet.ws.Application
int TotalRows = 0
Excel.Workbook wb
Excel.Worksheet ws
foreach wb XLSapp.Workbooks
str wbName=wb.Name
int nSheets=wb.Worksheets.Count
out "%i worksheets in %s:" nSheets wbName
foreach ws wb.Worksheets
int CompWsheet = StrCompare(ws.Name WorkSheet)
if CompWsheet = 0
you can assign Excel.Worksheet to ExcelSheet:
ExcelSheet es3=ws
TotalRows = es3.NumRows
int i
for i 1 TotalRows
out i
out "Row Num:%s" es3.Cell(F"{ColName}{i}")
str ExpKeyName = es3.Cell(F"{ColName}{i}")
int CompWlang = StrCompare(ExpKeyName ExpLanguage)
if CompWlang = 0
str ExpSheet = es3.Cell(F"B{i}")
str ExpColumn = es3.Cell(F"C{i}")
out ExpSheet
out ExpColumn
ret ExpSheet
ret ExpColumn



However in return value am only getting numeric value or handle "75476408" However output in the function in other .qml file is showing correct value see the output below:
Sheet2
C
75476408
#2
function# is the same as function'int - the function returns an integer number.
If you want to convert string to number - ret val(ExpSheet)
If you want to return string, replace function# to function'str


Forum Jump:


Users browsing this thread: 1 Guest(s)