helloworld 0 Newbie Poster

Hello can anyone please help me with some code, as you may be aware ASC means:
Function Asc(String As String) As Integer

Public Function Zeichen_OUT(Zeichen As String, wheelNr As Integer) As String
'go left, direction reflector (Umkehrwalze)
Dim Z As Integer
Dim offsetZ As Integer
offsetZ = RotorOffset(wheelNr) - RingOffset(wheelNr)
Z = (Asc(Zeichen) - 64) + offsetZ
If Z < 1 Then Z = Z + 26
If Z > 26 Then Z = Z - 26
Zeichen = Mid(ROTORS(RotorType(wheelNr)), Z, 1)
Z = (Asc(Zeichen) - 64) - offsetZ
If Z < 1 Then Z = Z + 26
If Z > 26 Then Z = Z - 26
Zeichen_OUT = Chr(Z + 64)
End Function

I need some code which will work for string as string as string as integer and so on, as you know asc only works for

Public Function Zeichen_OUT(Zeichen As String, wheelNr As Integer) As String
'go left, direction reflector (Umkehrwalze)
Dim Z As Integer String As String As Integer, is there any where to expand, let say string as string as string as integer, if so can you please amend it and show me please, am designing an machine for maths, I have tried many , none works,

I have tried a as string as string as intefer, but does not work.
Z = (a(Zeichen) - 64) + offsetZ

Nicky


Dim offsetZ As Integer
offsetZ = RotorOffset(wheelNr) - RingOffset(wheelNr)
Z = (Asc(Zeichen) - 64) + offsetZ
If Z < 1 Then Z = Z + 26
If Z > 26 Then Z = Z - 26
Zeichen = Mid(ROTORS(RotorType(wheelNr)), Z, 1)
Z = (Asc(Zeichen) - 64) - offsetZ
If Z < 1 Then Z = Z + 26
If Z > 26 Then Z = Z - 26
Zeichen_OUT = Chr(Z + 64)
End Function

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.