ncgjiju
8th August 2008, 07:00
Hi,

How to convert the string value into double type variable. Here is the code i have tried -

function readisissue()
|-------------------------------------------------------------------------------
|read the transfer table to check for issue of material for workorder no
|-------------------------------------------------------------------------------
select whinh200.*,whinh220.*
from whinh200,whinh220
where whinh200.oorg = whinh.oorg.transfer.man
and whinh200.ittp = whinh.ittp.transfer
and (whinh200.stco = "WIPFT2" or whinh200.stco = "WIPFT3")
and whinh200.sfty = whinh.type.warehouse
and whinh200.stty = whinh.type.warehouse
and whinh220.item = :tibom010.sitm
and whinh200.oorg = whinh220.oorg
and whinh200.orno = whinh220.orno
and whinh200.oset = whinh220.oset
and whinh220.lsta = whinh.lstb.shipped
and whinh220.qshp > 0
selectdo
txt.num = 0
|------------------------------------------------------------------
txt.num = int(whinh220.txtn) -> part that failing
|------------------------------------------------------------------
orno.a = ""
orno.a = strip$(str$(whinh220.txtn))
txt.num = int(orno.a)

if ( not isdigit(orno.a) ) then
message( "'%s' is not a number", whinh220.txtn )
else
message("'%s' is a number", whinh220.txtn )

endif

endselect
|-------------------------------------------------------------------------------
|read the transfer table to check for issue of material for workorder no
|-------------------------------------------------------------------------------

}

manish_patel
8th August 2008, 07:58
Hi,

You can use val() function.
eg txt.num = val(whinh220.txtn)

Syntax
double val( string_expr )

Desc
These convert a string expression that consists of digits to its numeric representation.

br,
Manish

ncgjiju
8th August 2008, 08:40
Thank you , I had forgoten about the val function.

regards,

George