Sign in to follow this  
Followers 0
sonicxtacy02

How do i write string characters to an array

5 posts in this topic

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?

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

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

Share this post


Link to post
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]

Share this post


Link to post
Share on other sites

didnt dawn on me that i could use "" as a delimiter.. pays to read the help file i guess. Thanks guys

and no i cant use macros because i'm not reading the current time persay, just used that as a simple example.

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