base:SystemRequest()

You can post your code snippets here for others to use and learn from
Post Reply
djrikki
Posts: 682
Joined: Wed Apr 06, 2011 12:26 am

base:SystemRequest()

Post by djrikki »

This is a replacement for the internal SystemRequest() command, or rather an extended version of the original which goes one step further and removes them pesky formatting characters that can appear; tbh since I've moved over to MUI Royale I don't really encounter the formatting characters anymore.

Code: Select all

Global base
base = {}

;; base:StripBoldandUnderlineFormatting(gadgets$)
; Removes underline characters from a string, used when displaying locales via a SystemRequest call for example
Function base:StripBoldandUnderlineFormatting(gadgets$)
    gadgets$ = ToString(gadgets$)
    gadgets$ = ReplaceStr(gadgets$,"[u]","")
    gadgets$ = ReplaceStr(gadgets$,"[/u]","")
    gadgets$ = ReplaceStr(gadgets$,"[b]","")
    gadgets$ = ReplaceStr(gadgets$,"[/b]","")
    Return (gadgets$)
EndFunction
    
Function base:SystemRequest(title,body,gadgets,icon)
	Local res = SystemRequest(base:StripBoldandUnderlineFormatting(title),base:StripBoldandUnderlineFormatting(body),base:StripBoldandUnderlineFormatting(gadgets),icon)
	Return (res)
EndFunction
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com
Post Reply