Upgrde Help

C

csgraham74

Hi Guys,

Im trying to upgrade some code to asp.net but im getting a few errors
on a couple of sectionsL

they errors are in the following

in the above below it doesnt seem to like the string function:

lStrPadMessage = pStrMessage & Chr(128) & STRING((128 - (lLngLen Mod
64) - 9) Mod 64, Chr(0)) & STRING(4, Chr(0)) & Chr(lBytLenW(0)) &
Chr(lBytLenW(1)) & Chr(lBytLenW(2)) & Chr(lBytLenW(3))



in the code below asp.net vb doesnt seem to like the array code

lVarWordWAry(lIntT) = ARRAY(Asc(Mid(lStrWordText, 1, 1)),
Asc(Mid(lStrWordText, 2, 1)), Asc(Mid(lStrWordText, 3, 1)),
Asc(Mid(lStrWordText, 4, 1)))

any help or workarounds appreciated

thanks

CG
 
H

Herfried K. Wagner [MVP]

csgraham74 said:
Im trying to upgrade some code to asp.net but im getting a few errors
on a couple of sectionsL

they errors are in the following

in the above below it doesnt seem to like the string function:

lStrPadMessage = pStrMessage & Chr(128) & STRING((128 - (lLngLen Mod
64) - 9) Mod 64, Chr(0)) & STRING(4, Chr(0)) & Chr(lBytLenW(0)) &
Chr(lBytLenW(1)) & Chr(lBytLenW(2)) & Chr(lBytLenW(3))

'String' => 'StrDup' or the 'String' class' constructor.
in the code below asp.net vb doesnt seem to like the array code

lVarWordWAry(lIntT) = ARRAY(Asc(Mid(lStrWordText, 1, 1)),
Asc(Mid(lStrWordText, 2, 1)), Asc(Mid(lStrWordText, 3, 1)),
Asc(Mid(lStrWordText, 4, 1)))

\\\
.... = _
New <Type>() { _
<Item 1>, _
<Item 2>, _
..., _
<Item n> _
}
///
 
C

csgraham74

thanks for that

i got the second of the two issues sorted so thank you but im still
just not sure about the first one

lStrPadMessage = pStrMessage & Chr(128) & STRING((128 - (lLngLen Mod
64) - 9) Mod 64, Chr(0)) & STRING(4, Chr(0)) & Chr(lBytLenW(0)) &
Chr(lBytLenW(1)) & Chr(lBytLenW(2)) & Chr(lBytLenW(3))

it is the STRING function that has the old blue line under it and says
'string' is a class and csnnot be used as an expression.

sorry for the trouble - but if possible could you give me a little
more on this. i have tried the following but could you tell me if it
is the same thing as the line above ??????

Dim str As String = New String(Chr(0), (128 - (lLngLen Mod 64) - 9)
Mod 64)
Dim str2 As String = New String(Chr(0) & Chr(lBytLenW(0)) &
Chr(lBytLenW(1)) & Chr(lBytLenW(2)) & Chr(lBytLenW(3)), 4)

lStrPadMessage = pStrMessage & Chr(128) & str & str2 &
Chr(lBytLenW(2)) & Chr(lBytLenW(3))

thanks again

Colin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top