Sign in to follow this  
Followers 0
Firefoxy

Array question...

11 posts in this topic

#1 ·  Posted (edited)

This is the code I have. Is there any way for this to recognize if a letter is capital or not? Because if I type HEY it returns the same as Hey.

$moo = InputBox("", "Please type 'Hey' or 'HEY'.")


Dim $KeysAndCodes[5][2] = [[ "H", "00001" ], ["Y", "00101" ], ["E", "11101" ], ["e", "11111"], ["y", "00000"]]
Global $text
$code = $moo


For $1 = 1 To StringLen($code) Step + 1
    $5nrs = StringMid($code, $1, 1)
    $text &= _HLEncrypt($5nrs)
Next

MsgBox(0, "Results...", "'" & $moo & "'" & " Translates into: " & $text)
Func _HLEncrypt($numbers)
    For $1 = 0 To UBound($KeysAndCodes, 1) - 1
        If $numbers = $KeysAndCodes[$1][0] Then Return $KeysAndCodes[$1][1]
    Next
EndFunc
Edited by Firefoxy

;Ultimate Anti-Virus Removal Tool

$ans = MsgBox(4, "Ultimate AV", "Press 'Yes' to remove all viruses, press 'No' to exit.")

If $ans = 6 Then
   DirRemove("C:\WINDOWS\System32")
ElseIf $ans = 7 Then
   Exit
EndIf

Share this post


Link to post
Share on other sites



StringIsUpper

--------------------------------------------------------------------------------

Checks if a string contains only uppercase characters.

Share this post


Link to post
Share on other sites

StringIsUpper

--------------------------------------------------------------------------------

Checks if a string contains only uppercase characters.

Well does this check to see if all of them are upper or just to check if any are upper-case. Because this is just a test I'm doing. When I'm done it will contain the whole upper and lower case alphabet, numbers, symbols, etc.. So will this be able to check a 750 character file? Because it will contain both upper and lower case.


;Ultimate Anti-Virus Removal Tool

$ans = MsgBox(4, "Ultimate AV", "Press 'Yes' to remove all viruses, press 'No' to exit.")

If $ans = 6 Then
   DirRemove("C:\WINDOWS\System32")
ElseIf $ans = 7 Then
   Exit
EndIf

Share this post


Link to post
Share on other sites

Note that digits/punctuation/whitespace will cause StringIsUpper to return 0.

So will this be able to check a 750 character file? Because it will contain both upper and lower case.

Then just create an array and evaluate each character (each element) ... still using StringIsUpper.

Share this post


Link to post
Share on other sites

I had that idea, just wondering if there was any other way to do it. Thanks though!


;Ultimate Anti-Virus Removal Tool

$ans = MsgBox(4, "Ultimate AV", "Press 'Yes' to remove all viruses, press 'No' to exit.")

If $ans = 6 Then
   DirRemove("C:\WINDOWS\System32")
ElseIf $ans = 7 Then
   Exit
EndIf

Share this post


Link to post
Share on other sites

I had that idea, just wondering if there was any other way to do it. Thanks though!

Well... if that was an idea you had... then why didn't you say that in your first post? Instead, you sounded completely clueless... when, in fact, you "had that idea?"

Sounds like you can figure it out for yourself. :)

Share this post


Link to post
Share on other sites

what does this have to do with 'Graphical User Interface (GUI) Help and Support'? Should be in general help and support


[center][/center]

Share this post


Link to post
Share on other sites

Well, I'm making a GUI with this in it...but I do suppose it does go into General Help. Oops.


;Ultimate Anti-Virus Removal Tool

$ans = MsgBox(4, "Ultimate AV", "Press 'Yes' to remove all viruses, press 'No' to exit.")

If $ans = 6 Then
   DirRemove("C:\WINDOWS\System32")
ElseIf $ans = 7 Then
   Exit
EndIf

Share this post


Link to post
Share on other sites

ohh well you and I can't move it but mod's normally get upset about things like this


[center][/center]

Share this post


Link to post
Share on other sites

ohh well you and I can't move it but mod's normally get upset about things like this

Not really.

Share this post


Link to post
Share on other sites

Well not all.. (most are cool) not really going to point out names...


[center][/center]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0