Created
February 13, 2017 01:16
-
-
Save ChadSki/a1d506b6602cf81e220b07cf73df3fc8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Red/System [ | |
Title: "Hello" | |
File: %messagebox.reds | |
] | |
; --- lib imports ----- | |
#import [ | |
"user32.dll" stdcall [ | |
MessageBox: "MessageBoxA" [ | |
handle [integer!] | |
text [c-string!] | |
title [c-string!] | |
type [integer!] | |
return: [integer!] | |
] | |
] | |
] | |
alert: func [txt [c-string!] return: [integer!]][ | |
MessageBox 0 txt "alert" 48 | |
] | |
confirm: func [txt [c-string!] return: [integer!] /local rep [integer!]][ | |
rep: MessageBox 0 txt "confirm" 4 | |
if rep = 6 [rep: 1] ; sinon rep = 7 | |
rep | |
] | |
rep: 0 | |
until [ | |
alert "Hello, Red world !" | |
rep: confirm "quit ?" | |
rep = 1 | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment