NetTalk Central

Author Topic: Too Many SegDef  (Read 910 times)

rupertvz

  • Sr. Member
  • ****
  • Posts: 314
    • View Profile
    • Email
Too Many SegDef
« on: October 05, 2023, 05:44:23 AM »
Hi Guys,

I also received the SegDef error recently, because of a very large form.
I've added the form on it's own CLW and seems to be working for now.

The client however, has a even longer form to be designed.

Is there a work-around, as I don't want to run into a dead-end with this project.


TimR

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: Too Many SegDef
« Reply #1 on: October 05, 2023, 12:58:32 PM »
You can separate the form into multiple procedures and place them together on another unified form. I had an issue with doing this that was easily solved, I'll just point you to the message instead of repeating the info
https://www.nettalkcentral.com/forum/index.php?topic=9211.msg37753#msg37753

rupertvz

  • Sr. Member
  • ****
  • Posts: 314
    • View Profile
    • Email
Re: Too Many SegDef
« Reply #2 on: October 10, 2023, 11:14:05 AM »
Thank you Tim,

This is very helpful.

Stu

  • Hero Member
  • *****
  • Posts: 509
    • View Profile
    • Email
Re: Too Many SegDef
« Reply #3 on: November 14, 2023, 05:22:45 PM »
I've got a growing number of "content builder" NetWebForm -> Wizard procs that are all very close (most of them by a few lines) to the segdef error popping.

It is a constant wrestle when considering further addition/updates, but good comes out of it I find.

This limitation has honestly caused me to create better interfaces.

E.g. 1 - Instead of having an artwork/image page of a few fields where the specific pieces of artwork for whatever content type get processed - swap this for a browse+form.

E.g. 2 - Instead of a set of checkboxes for items in a page/tab, swap for a browse with checkbox eip field and whatever logic is required to set the values.

E.g. 3 - Push as many of my own routines into procs as is possible, that can then be called from a single line (I find my routines can grow pretty large over time).

E.g. 4 - Utilise p_web.SessionQueueToFile() and FileToSessionQueue() - I find these very powerful, and are very low-hanging fruit (instead of lines of <this variable> = p_web.GSV('<this variable>').

E.g. 5 - Any functionality that can be moved into popup forms (or browses like the above two egs), work to do this.
Cheers,

Stu Andrews

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11179
    • View Profile
Re: Too Many SegDef
« Reply #4 on: November 14, 2023, 11:52:56 PM »
It's worth noting that the SegDef limitation is not in "the amount of code" but rather the "number of named things".
So variables, routines, and so on.

All of what Stu says is good advice, but reducing the number of calls to SSV or whatever won't move the needle.

Cheers
Bruce

Stu

  • Hero Member
  • *****
  • Posts: 509
    • View Profile
    • Email
Re: Too Many SegDef
« Reply #5 on: November 19, 2023, 02:40:20 PM »
It's worth noting that the SegDef limitation is not in "the amount of code" but rather the "number of named things".
So variables, routines, and so on.

Cheers
Bruce

Oh nice. I didn't realise this.

Good stuff Bruce, many thanks!
Cheers,

Stu Andrews