News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Turning a string into a number.

Started by KcDan, August 14, 2005, 01:20:40 AM

Previous topic - Next topic

KcDan

Im currently working on a Media Player and Im using mciSendString to display and control the media.

An important part of my program involves getting the length of the media file loaded by using the command string 'status movie length'.

Data

TotalLengthMP db 'status movie length',0
TotalLength dd 257 dup (0)


Code

LOCAL TotalLength:DWORD
invoke mciSendString,addr TotalLengthMP,addr TotalLength,sizeof TotalLength,0


How can I get the number thats in TotalLength and put it in TotalLength?

Mark Jones

Hi Dan. What specifically are you trying to do, your discription is a little ambiguous. Maybe this will help:


; lets say that StatusMovieLength is ASCII "123456",0
    invoke mciSendString,addr TotalLengthMP,addr StatusMovieLength,sizeof TotalLength,0
    invoke atodw,addr StatusMovieLength ; returns eax (0x1E240)
; use eax or copy its value somewhere
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

KcDan

Sorry about my post, I was quite tired when I made it. Also thanks for the solution to my problem.

Mark Jones

"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08