Skip to content

Instantly share code, notes, and snippets.

@ChadSki
Created February 13, 2017 01:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChadSki/a1d506b6602cf81e220b07cf73df3fc8 to your computer and use it in GitHub Desktop.
Save ChadSki/a1d506b6602cf81e220b07cf73df3fc8 to your computer and use it in GitHub Desktop.
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