NetTalk Central

Author Topic: Too Many SegDef  (Read 4326 times)

rupertvz

  • Sr. Member
  • ****
  • Posts: 323
    • 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: 323
    • 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: 510
    • 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: 11238
    • 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: 510
    • 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

rupertvz

  • Sr. Member
  • ****
  • Posts: 323
    • View Profile
    • Email
Re: Too Many SegDef
« Reply #6 on: June 26, 2024, 11:07:57 AM »
I've also been hitting the segdef problem more lately.
Main cause on my side is very large forms from the client side.
I've been redesigning the forms with different tabs, calling separate procedures.

However, I found that went I call a new procedure from within a NWF-tab, the controls in the new NWF seems to be broken somehow.
For example, the checkboxes break completely in the second NWF, whilst the checkboxes on the calling NWF still works.

I thought it had to do with some faulty control and/or code, but after redoing the NWF, I ran into the same issue.

Alberto

  • Hero Member
  • *****
  • Posts: 1869
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: Too Many SegDef
« Reply #7 on: June 26, 2024, 12:32:26 PM »
rupertvz
If you are inserting a form on a form you need to make it memory and uncheck the add <form> tag
-----------
Regards
Alberto

rupertvz

  • Sr. Member
  • ****
  • Posts: 323
    • View Profile
    • Email
Re: Too Many SegDef
« Reply #8 on: June 26, 2024, 09:47:21 PM »
Thank you Alberto,

I did make it a memory form, but have not yet tried removing the "Form tag"
Let me try this and see.
« Last Edit: June 26, 2024, 10:48:51 PM by rupertvz »