$segments.$add() crashes Studio
Thanks Chris,
I’ve ended up with something similar, the O$5 part is lousy but it works.
By the way, I couldn’t find any documentation about $mode, $dotoolmethod()
Could be useful if someone could share this
Thanks
JM
> Le 10 août 2017 à 00:47, Chris Hughes <ataddata@bigpond.net.au> a écrit :
>
> Found it from memory it will prompt the user to add the size, you will have
> to tell the size.
>
> That’s why we gave up Studio 5 not a good version.
>
>
> On evClick
> Do FileOps.$splitpathname($cdata().$pathname,LvDrv,LvDir,LvName,LvExt)
> Yes/No message What Happening (Icon) {This is about to create a new Segment
> of the data file called [LvName] do want to proceed.}
> If flag false
> Quit method
> End If
> Calculate LvPath as con(LvDrv,LvDir)
> ;
> Calculate LvSys as sys(1)
> Switch LvSys
> Case 5
> ;
> Calculate LvText as ‘kEnvToolBrowser’
> Do $root.$modes.$dotoolmethod(LvText,31,LvName)
> ;
> Default ;; This works on studio 3 and 4.
> ;
> Do $cdata.$shared.$assign(kFalse) Returns #F ;; Adding a New segment:
> If flag true
> Do $root.$datas.LvName.$segments.$add(LvPath,268435456) ;; Creates a new
> segment with the maximum size of ~256 MB
> Do $cdata.$segments.$add(LvPath,268435456)
> End If
> Do $cdata.$shared.$assign(kTrue) Returns #F
> Do method BldSegmentList
> OK message Advice {New segment should have been created please check for
> [LvName] higher than Df1.}
> ;
> End Switch
>
>
>
> Chris Hughes
>
> Copious Data Pty Ltd (Trading as Atad Data)
> Unit 8 /3460 Pacific Highway
> Springwood QLD 4127
> Phone No:- 07 3208 6347
> Mobile No:- 0409 263 349
> Fax No:- 07 3208 9347
> Email:- ataddata@bigpond.net.au
> Web Site:- ataddata.com.au
>
>
>
> —–Original Message—–
> From: omnisdev-en [mailto:omnisdev-en-bounces@lists.omnis-dev.com] On Behalf
> Of Jean Marc Azerad
> Sent: Wednesday, 9 August 2017 6:33 PM
> To: OmnisDev List – English
> Subject: $segments.$add() crashes Studio
>
> Hi guys,
>
> Sorry to bother with some antic kind of code, but I need to solve this issue
> fast.
>
> I have one customer still on DF1,who needs to add a segment on all his
> sites.
> The following code works on Mac but crashes Studio on PCs, (XP & 7) The
> manual addition of segment does work perfectly on Mac and PC, so it is not a
> matter of user’s rights
>
>
> Calculate Size as 524000
> Do $root.$datas.Edmus.$segments.$add(PathData,Size,ErrorCode) Returns DfPlus
>
>
> PathData contains C:DEVEDMUS (OS5)EDMUSdata Which where the DF1 is.
>
> Studio 5.2.3
>
> Any clue very welcome
>
> Thank you
>
>
> JM
> _____________________________________________________________
> Manage your list subscriptions at lists.omnis-dev.com
>
> _____________________________________________________________
> Manage your list subscriptions at lists.omnis-dev.com
_____________________________________________________________
Manage your list subscriptions at lists.omnis-dev.com