Suneido

Integrated Application Platform

  • Home
  • Learning
    • Suneido Manual
    • Beginners
      • Inside Suneido
      • The Suneido Programming Language
      • The Suneido Database
      • Installing Suneido
      • Building Suneido
      • IDE Go To Tour
      • Upgrading To A New Release
    • Advanced
      • Canvas Control
      • DrawControl Part 1
      • DrawControl Part 2
      • DrawControl Part 3
      • SAX Like XML Processing
      • A Plug-In Architecture
      • A Simple Wizard Framework
      • An HTML Include Facility
      • An RSS 2 Feed Creator
      • MIME Generation
      • A New Add-on Facility
      • Workspace Improvement Hack
    • Mockito for Suneido
    • The Suneido Task Scheduler
    • Contributing To Suneido
    • Contributor Assignment of Copyright
    • Language Translation
    • Future Directions
    • Interview With Andrew Mckinlay
  • Forum
    • Announcements
    • Internals & Enhancements
    • Cookbook
    • General
  • FAQ
  • Screenshots
  • Downloads
  • Links

[SOLVED]Does suneido support referenced variables?

Integrated Application Platform › Forums › General › [SOLVED]Does suneido support referenced variables?

  • This topic has 2 replies, 2 voices, and was last updated 8 years, 6 months ago by jaska_lee.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • August 12, 2014 at 12:18 pm #779
    jaska_lee
    Participant

    Like in some other languages when variables are passed into function as parameters, values of parameters are changed inside of that function, the original variables value are also changed automatically.

    Does suneido support this kind of operation?

    August 12, 2014 at 2:55 pm #1068
    j_ferguson
    Moderator

    Most data types in Suneido are passed by value but Objects are passed by reference so changing the object inside the function being called will change the original object.

    August 13, 2014 at 2:08 am #1069
    jaska_lee
    Participant

    j_ferguson: Thanks for the clarification. So its only for object type in this case, not for other types. I created a function,

    function (text)
    {
    if Object?(text)
    text[0] = 'hi suneido'
    }

    And I executed following code in Workspace,

    txt1 = 'hello suneido'
    ob = Object(txt1)
    ChangeText(ob)
    Print(ob[0])

    Everything works as expected. But as you can see, I had to pack the variables into an object and that causes quite some additional thinking/typing. It would be nice to be just

    function (ref text)
    {
    text = 'hi suneido'
    }

    txt1 = 'hello suneido'
    ChangeText(txt1)
    Print(txt1)

    Anyway, its just an idea. For now, I guess the first option is the way to go.

    Thanks a lot

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Log In

Search Forums

Log In
Welcome to the new Suneido Web Site and Forum.
Register
Lost Password
users of the previous PHPBB Forum should be able to log in with their previous username and password.

Recent Topics

  • Alpha copy of gSuneido to play with
  • how to start jsuneido ?
  • Problem Starting Suneido…
  • Dialog not showing buttons
  • New link for Suneidojo

Contact Us | Legal Statement | Privacy Statement | SiteMap

Copyright © 2023 Axon® Development Corporation. All Rights Reserved. - Open Source Integrated Database and Programming Language