There's probably a really obvious way to do this.
I am creating an Object BerthTypes. BerthTypes has a maximum value. I want to create an Object Berth for however many is specified in BerthTypes.Maximum.
That is straightforward
CREATE Berth FOR EACH NUMBER BETWEEN 1 AND BerthTypes.Maximum
However I want to populate a field with a descriptor and a number as a default eg. MOORING 1, MOORING 2, MOORING 3 ... MOORING [BerthTypes.Maximum]
Is there a straightforward way to do this? The counter is independent of everything else in the system so SystemSettings is not use and CREATE ... FOR EACH won't update the LIRU
CREATE ... FOR EACH & Incremental Numbers
-
- Posts: 1457
- Joined: Tue Jan 24, 2017 5:51 am
- Location: 'Stralya
-
- Posts: 2399
- Joined: Mon Jul 02, 2012 12:24 am
- Location: Ulaanbaatar, Mongolia
Re: CREATE ... FOR EACH & Incremental Numbers
Try,
CREATE Berth FOR EACH NUMBER BETWEEN 1 AND BerthTypes.Maximum WITH Berth.Mooring='MOORING '+LOOP_ITERATION
CREATE Berth FOR EACH NUMBER BETWEEN 1 AND BerthTypes.Maximum WITH Berth.Mooring='MOORING '+LOOP_ITERATION
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
-
- Posts: 1457
- Joined: Tue Jan 24, 2017 5:51 am
- Location: 'Stralya
Re: CREATE ... FOR EACH & Incremental Numbers
That is much more elegant that what I did.eagles9999 wrote:Try,
CREATE Berth FOR EACH NUMBER BETWEEN 1 AND BerthTypes.Maximum WITH Berth.Mooring='MOORING '+LOOP_ITERATION
Thank you!
Re: CREATE ... FOR EACH & Incremental Numbers
That means you will be going to his conference...PointsWell wrote: That is much more elegant that what I did.
Thank you!