Example: /Util/String References Test

Online Documentation   -   Statistics   -   FAQ   -   Plugin Parts (All, Dependencies)   -   Class hierarchy

New in Version 22.2 22.3 22.4 22.5 23.0 23.1 23.2 23.3 23.4 23.5 24.0 24.1

The list of the   topics,   classes,   interfaces,   controls,   modules,   global methods by category,   global methods by name,   screenshots,   licenses   and   examples.

Platforms to show: All Mac Windows Linux Cross-Platform

/Util/String References Test


Required plugins for this example: MBS Util Plugin

You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Util/String References Test

This example is the version from Thu, 7th Jun 2017.

Project "String References Test.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Delete"
Const kFileQuit = "&Quit"
Const kFileQuitShortcut = ""
EventHandler Sub Open() // test String references dim a as string = "Hello" dim b as string = a // no copy dim c as string = left(a,5) // no copy dim d as string = "Hello" // gets same constant string dim pa as integer = GetStringMemoryAddressMBS(a) dim pb as integer = GetStringMemoryAddressMBS(b) dim pc as integer = GetStringMemoryAddressMBS(c) dim pd as integer = GetStringMemoryAddressMBS(d) #if RBVersion >= 2014.03 then // test Text references dim e as text = "Hello" dim f as text = e // no copy dim g as text = f.Left(5) // no copy dim h as text = "Hello" // gets same constant text dim pe as integer = GetTextMemoryAddressMBS(e) dim pf as integer = GetTextMemoryAddressMBS(f) dim pg as integer = GetTextMemoryAddressMBS(g) dim ph as integer = GetTextMemoryAddressMBS(h) // test Auto references dim i as auto = "Hello" dim j as auto = i // no copy dim k as auto = "Hello" // same text, but new auto object dim l as auto = k // no copy dim pi as integer = GetAutoMemoryAddressMBS(i) dim pj as integer = GetAutoMemoryAddressMBS(j) dim pk as integer = GetAutoMemoryAddressMBS(k) dim pl as integer = GetAutoMemoryAddressMBS(l) #endif dim m as Object = app dim n as Object = m // no copy dim o as Variant = 123 // new Variant object dim p as Variant = o // no copy dim pm as integer = GetObjectMemoryAddressMBS(m) dim pn as integer = GetObjectMemoryAddressMBS(n) dim po as integer = GetObjectMemoryAddressMBS(o) dim pp as integer = GetObjectMemoryAddressMBS(p) Break // see in debugger End EventHandler
End Class
MenuBar MainMenuBar
MenuItem FileMenu = "&File"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem EditSeparator1 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "#App.kEditClear"
MenuItem EditSeparator2 = "-"
MenuItem EditSelectAll = "Select &All"
End MenuBar
End Project

The items on this page are in the following plugins: MBS Util Plugin.


💬 Ask a question or report a problem