News:

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

German Date & Time

Started by herge, June 22, 2008, 09:45:38 AM

Previous topic - Next topic

herge


Hi I am trying to figure out how to get the Date and print in German.
I tried changer user default 400 to country code of Germany 49
this did not work!


invoke GetDateFormat,49,DATE_LONGDATE,0,0,ADDR buffer1,260


Regards herge.
// Herge born  Brussels, Belgium May 22, 1907
// Died March 3, 1983
// Cartoonist of Tintin and Snowy

GregL

Herge,

The locale identifier for German (Germany) is 407h or 1031.


jj2007

Cute, thanks for this!

Date & time in German, 1536 bytes exe:

include \masm32\include\masm32rt.inc

.data?
dtbuf dd 20

°B2.code
AppName db "Date and time in German:", 0
crlf db 13, 10, 0
tf db "HH':'mm':'ss", 0

start: invoke GetDateFormat, 1031, DATE_LONGDATE, 0, 0, addr dtbuf, 80
invoke lstrcat, addr dtbuf, addr crlf
push esi
mov esi, offset dtbuf
add esi, len(esi)
invoke GetTimeFormat, 1031, 0, 0, addr tf, esi, 40
pop esi
invoke MessageBox, NULL, addr dtbuf, addr AppName, MB_OK
exit

end start

herge


Hi jj2007:

It don't like * b2.code invalid character.

Regards herge.
// Herge born  Brussels, Belgium May 22, 1907
// Died March 3, 1983
// Cartoonist of Tintin and Snowy

herge


Hi Greg:

the 1031 sort of works.
The specified module could not be found.
The time is okay.

Regards herge.
// Herge born  Brussels, Belgium May 22, 1907
// Died March 3, 1983
// Cartoonist of Tintin and Snowy

jj2007

Quote from: herge on June 23, 2008, 10:51:50 AM
It don't like * b2.code invalid character.

Yep, I should refine my copy routine to avoid copying the internal bookmarks... after removing * b2, it should work fine.

herge

 Hi Greg and jj2007:


; GERMAN.ASM 11:46 AM 6/23/2008
include \masm32\include\masm32rt.inc

.data
dtbuf db 260 dup(0)

AppName db "Date and time in German:", 0
crlf db 13, 10, 0
tf db "HH':'mm':'ss", 0
.code
main proc
invoke GetDateFormat, 1031, DATE_LONGDATE, 0, 0, addr dtbuf, 260
invoke lstrcat, addr dtbuf, addr crlf
push esi
mov esi, offset dtbuf
add esi, len(esi)
invoke GetTimeFormat, 1031, 0, 0, addr tf, esi, 40
pop esi
invoke MessageBox, NULL, addr dtbuf, addr AppName, MB_OK
exit
      ret
main endp
end main




We Have liftoff!
Montag, 23, Juni 2008
12:04:00

I could not get end start to work
so I used end main

Regards herge.
// Herge born  Brussels, Belgium May 22, 1907
// Died March 3, 1983
// Cartoonist of Tintin and Snowy

jj2007

Quote from: herge on June 23, 2008, 04:11:14 PM
I could not get end start to work
so I used end main

.code
start:
invoke ...
invoke MessageBox, NULL, addr dtbuf, addr AppName, MB_OK
exit
end start

This works. Regards, jj

herge

 Hi jj2007:


Assembling: german.asm
german.asm(24) : error A2006: undefined symbol : start
german.asm(24) : error A2148: invalid symbol type in expression : start
_
Assembly Error
Press any key to continue . . .


I most admit I don't know what's wrong but it
does not llike start and I usually always
end start.

If I throw away main proc
and main endp
it works Great.

But it does work thank you.

Regards herge.
// Herge born  Brussels, Belgium May 22, 1907
// Died March 3, 1983
// Cartoonist of Tintin and Snowy

GregL

herge,

The bit after END specifies the program entry point.

    END