New topic: Passing an element of a Structure using ByRef
<http://forums.realsoftware.com/viewtopic.php?t=29413> Page 1 of 1 [ 1 post ] Previous topic | Next topic Author Message Richard47 Post subject: Passing an element of a Structure using ByRefPosted: Wed Aug 05, 2009 4:48 pm Joined: Sun Feb 22, 2009 11:29 am Posts: 3 Often when converting my Fortan 90 progams to REALbasic I would like to be able to use an element of a Structure as an argument in a subroutine call. For example I would like to return data into both field and poi(i).name in the following Code:testSub("This is a test",field,poi(i).name) where testSub is defined in this way Code:Sub testSub(param1 As String, ByRef Param2 As String, ByRef Param3 As String) and poi(i).name is an entry in a Structure. Currently this results in the following error You can't pass an expression as a parameter that is defined as ByRef, testSub("This is a test",field,poi(i).name) To get round this I have to adopt the following solution Code:testSub("This is a test",field,poi_name) poi(i).name = poi_name As the statement testSub("This is a test",field,poi(i).name) is acceptable in Fortran 90 why does it not work in REALbasic? Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 1 post ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
