Jump to content

How do i write string characters to an array


Recommended Posts

This is probably another BASIC question but i dont have a real great understanding of arrays. I have an OCR script that returns strings to me representing certain times of the day. The problem is i cant get my ocr to read the ":" character correctly. Everything other character comes back fine. So what i'd like to do is take the string and convert each character to an index number of an array. For instance:

$string= 1022AM

$tarray[1]=1

$tarray[2]=0

$tarray[3]=2

$tarray[4]=2

$tarray[5]=A

$tarray[6]=M

i wanna do this so i can properly recreate the string to display in the correct format (10:22 AM). How do i go about doing this?

Link to comment
Share on other sites

Hi,

have a look at StringSplit()

So long,

Mega

Edit: Mod bonus, so you are first ;)

Edited by th.meger

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

Could you use @HOUR and @ MIN instead, thereby eliminating your problem altogether?

IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...