"Unexpected Endlibrary?" What?

LurkerAspect

Now officially a Super Lurker
Reaction score
118
Hi again :D

This time I have a really annoying problem which is threatening to capsize my whole project at the moment, whenever I try to save the map, Jasshelper jumps in and screams at me for an "unexpected endlibrary". However, when I delete that endlibrary, it doesn't register it as a library, then I get nesting problems :nuts:

Here's where the endlibrary problem is given; this is copy-pasted from JassHelper:
JASS:
endfunction

endlibrary

endlibrary//===========================================================================
// Trigger: ABC
//===========================================================================
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
I'm pretty sure you can't end a library that doesn't exist...
 

LurkerAspect

Now officially a Super Lurker
Reaction score
118
-_-'

That's just an extract from what it said, should I rather post the whole section?
 

quraji

zap
Reaction score
144
In other words, you have two endlibrary's which ends the library, then tries to end one that doesn't exist after that. Delete one.
 

LurkerAspect

Now officially a Super Lurker
Reaction score
118
Well, you see, the problem is that when I delete the one, then it doesn't put another one before the "ABC" trigger. Then it gets buggered, so I have to put it back in, in which case it gets buggered again.
 

T.s.e

Wish I was old and a little sentimental
Reaction score
133
Post the whole trigger above the endlibrary statements please.
 

LurkerAspect

Now officially a Super Lurker
Reaction score
118
jasshelpererror2.jpg


Then if I delete that endlibrary:
jasshelpererror3.jpg

:confused:
 

Larcenist

REP: Respect, Envy, Prosperity?
Reaction score
211
Post the code of the library causing it, can't do much helping without the code.
 

LurkerAspect

Now officially a Super Lurker
Reaction score
118
JASS:
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//  ~~    Event     ~~    By Jesus4Lyf    ~~    Version 1.02    ~~
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
//  What is Event?
//         - Event simulates Warcraft III events. They can be created,
//           registered for, fired and also destroyed.
//         - Event, therefore, can also be used like a trigger "group".
//         - This was created when there was an influx of event style systems 
//           emerging that could really benefit from a standardised custom
//           events snippet. Many users were trying to achieve the same thing
//           and making the same kind of errors. This snippet aims to solve that.
//
//  Functions:
//         - Event.create()     --> Creates a new Event.
//         - .chainDestroy()    --> Destroys an Event.
//                                  DO NOT use .destroy().
//         - .fire()            --> Fires all triggers which have been
//                                  registered on this Event.
//         - .register(trigger) --> Registers another trigger on this Event.
//
//  Details:
//         - Event is extremely efficient and lightweight.
//         - It is safe to use with dynamic triggers.
//         - Internally, it is just a singularly linked list. Very simple.
//
//  How to import:
//         - Create a trigger named Event.
//         - Convert it to custom text and replace the whole trigger text with this.
//
//  Thanks:
//         - Builder Bob for the trigger destroy detection method.
//         - Azlier for inspiring this by ripping off my dodgier code.
//
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
library Event
    ///////////////
    // EventRegs //
    ////////////////////////////////////////////////////////////////////////////
    // For reading this far, you can learn one thing more.
    // Unlike normal Warcraft III events, you can attach to Event registries.
    // 
    // Event Registries are registrations of one trigger on one event.
    // These cannot be created or destroyed, just attached to.
    //
    // It is VERY efficient for loading and saving data.
    // 
    //  Functions:
    //         - set eventReg.data = someStruct --> Store data.
    //         - eventReg.data                  --> Retreive data.
    //         - Event.getTriggeringEventReg()  --> Get the triggering EventReg.
    // 
    struct EventReg
        integer data
        method clear takes nothing returns nothing
            set this.data=0
        endmethod
    endstruct
    
    struct Event
        private trigger trig
        private Event next
        static method create takes nothing returns Event
            local Event this=Event.allocate()
            set this.next=0
            return this
        endmethod
        private static Event current
        static method getTriggeringEventReg takes nothing returns EventReg
            return .current
        endmethod
        private static trigger t
        method fire takes nothing returns nothing
            // this = last.
            loop
                set .current=this.next
                exitwhen .current==0
                set .t=.current.trig
                if IsTriggerEnabled(.t) then
                    if TriggerEvaluate(.t) then
                        call TriggerExecute(.t)
                    endif
                    set this=.current
                else
                    call EnableTrigger(.t) // Was trigger destroyed?
                    if IsTriggerEnabled(.t) then
                        call DisableTrigger(.t)
                        set this=.current
                    else // If trigger destroyed...
                        set .current.trig=null
                        set this.next=.current.next
                        call .current.destroy()
                    endif
                endif
            endloop
        endmethod
        method register takes trigger t returns EventReg
            local Event new=Event.allocate()
            set new.next=this.next
            set new.trig=t
            set this.next=new
            call EventReg(new).clear()
            return new
        endmethod
        method chainDestroy takes nothing returns nothing
            loop
                call this.destroy()
                set this=this.next
                exitwhen this==0
                set this.trig=null
            endloop
        endmethod
    endstruct
    
    /////////////////////////////////////////////////////
    // Demonstration Functions & Alternative Interface //
    ////////////////////////////////////////////////////////////////////////////
    // What this would look like in normal WC3 style JASS (should all inline).
    // 
    function CreateEvent takes nothing returns Event
        return Event.create()
    endfunction
    function DestroyEvent takes Event whichEvent returns nothing
        call whichEvent.chainDestroy()
    endfunction
    function FireEvent takes Event whichEvent returns nothing
        call whichEvent.fire()
    endfunction
    function TriggerRegisterEvent takes trigger whichTrigger, Event whichEvent returns EventReg
        return whichEvent.register(whichTrigger)
    endfunction
    
    // And for EventRegs...
    function SetEventRegData takes EventReg whichEventReg, integer data returns nothing
        set whichEventReg.data=data
    endfunction
    function GetEventRegData takes EventReg whichEventReg returns integer
        return whichEventReg.data
    endfunction
    function GetTriggeringEventReg takes nothing returns integer
        return Event.getTriggeringEventReg()
    endfunction

The endlibrary should be right at the bottom, but when I put one there, I get picture A, and if I don't, I get picture B.
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
just take away the second endlibrary and just put library
 

Larcenist

REP: Respect, Envy, Prosperity?
Reaction score
211
You're positive it's that trigger that's causing it? Tried disabling it?
 

LurkerAspect

Now officially a Super Lurker
Reaction score
118
No, that wasn't the cause. Don't worry, I've solved the problem, but it's revealed a much larger problem to me.

For some reason, before all this happened, most of my endscopes and endlibraries vanished. Don't ask me how, maybe it's a Newgen bug, but I swear they were gone. When I retyped them, they were causing compile errors with the invisible versions.

Anybody heard of that before? :nuts: I think it has something to do with the folding feature of Newgen.
 

Sevion

The DIY Ninja
Reaction score
413
I've never experienced trouble with folding, then again, whenever I fold I unfold it after I'm done.
 

Lyerae

I keep popping up on this site from time to time.
Reaction score
105
Does anyone even use the fold feature?
It's pretty pointless... If you don't want to look at your own code, you shouldn't have written it in the first place.
>.>
 

cleeezzz

The Undead Ranger.
Reaction score
268
i use it sometimes if i use too many long if/then/elses, it starts to get confusing (i indent properly) after it gets too long.

so i just fold the small ones to see clearly that i got them all
 

Sevion

The DIY Ninja
Reaction score
413
When I was getting function names for documentation on ItemGroup (click getLast() in my signature to find it), I folded my functions to see just function <NAME> <ARGS>.

So yes, people do use fold. It's not that they don't want to look at it cuz it sucks, it's just when things get long or you don't want to scroll back and forth so much.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top