B4J Question Why is the compiler looking for a variable declared in another module?

Status
Not open for further replies.

B4JExplorer

Active Member
Licensed User
Longtime User
Hi,

I figured out how to manually include the XLUtil library, by manually inserting Library2=xlutils into a console app that I built anew. I found that out, by searching through the Example.zip that was provided as an attachment on one of the posts about the XLUtils library.

*****
Yes, no doubt it's covered somewhere in the forum, how to include the new b4xlib library types within the ide. The library types are described in full here

https://www.b4x.com/android/forum/threads/new-feature-b4x-lib-a-new-type-of-library.100383/#content

, but how do you glean exactly how to include a specific library (aside from putting it in the additional libraries folder) when you're creating a project?
*****


But now, my console app is apparently looking for a variable called xui. The console app was built from scratch, after closing B4J that had the Example.zip project, then re-opening B4J and creating the project.

The folder containing the console app is called ..\XLTest, and I searched globally all of the files in the ..\XLTest folder & subfolder, and there is no occurrence of 'xui'. Somehow, it's using the Example project as a dependency even though I didn't ask for that. (I think it's doing that, but am not even 80 percent certain).


This is the error:

Undeclared variable 'xiu' is used before it was assigned any value.


I've been away from B4J for several years, so a learning curve is expected. But I'm totally lost, and can't even get started with a simple project.
 

EnriqueGonzalez

Well-Known Member
Licensed User
Longtime User
b4xlibs should be shown like any other lib on the system thru the libraries manager tab.
the real problem here is that you cant use XUI library in a console app because there is no UI so it breaks your project just by adding it (in whichever way you actually added it)
 
Upvote 0

B4JExplorer

Active Member
Licensed User
Longtime User
And the XLUtil library is dependent on XIU? In the Library manager, none of the XUI (Views and 2D) are checked.

Ok, thanks Enrique. You saved me some headaches. I'll go back to an earlier Excel lib.

I think I have a Groovy app from around 8 years ago that uses the poi libraries. If none of the b4j excel libraries work in console mode, I'll just find that from a backup.
 

Attachments

  • LibrariesManager_01.png
    LibrariesManager_01.png
    44.3 KB · Views: 152
  • LibrariesManager_02.png
    LibrariesManager_02.png
    11 KB · Views: 160
Last edited:
Upvote 0

William Lancee

Well-Known Member
Licensed User
Longtime User
Note that console mode is not needed if you don't show the form in UI mode.
In other words do a UI App with MainForm.Show commented out and you can use xui, xlUtil and lots of other things without seeing a form.

That's what I do. I don't bother with console Apps anymore.
 
Upvote 0

B4JExplorer

Active Member
Licensed User
Longtime User
Note that console mode is not needed if you don't show the form in UI mode.
In other words do a UI App with MainForm.Show commented out and you can use xui, xlUtil and lots of other things without seeing a form.

That's what I do. I don't bother with console Apps anymore.
I don't maybe I'll try that, thanks Lancee.

I just kinda prefer the simplicity of a console application. I'm just doing scripting these days, and haven't had to deal with any gui elements for a couple of years.
 
Upvote 0

William Lancee

Well-Known Member
Licensed User
Longtime User
Unfamiliarity is often disguised as complexity.

For example, it is not more complicated to use B4XPages. It leads to a simpler unified approach to programming across very different platforms.

I urge you to become familiar with things like 'BBCodeview', 'smart strings', 'Wait For', 'B4Xpages', B4XOrderedMaps, and other state of the art B4X features.
I really believe you'll have fun expanding your horizons.
 
Last edited:
Upvote 0

B4JExplorer

Active Member
Licensed User
Longtime User
Unfamiliarity is often disguised as complexity.

For example, it is not more complicated to use B4XPages. It leads to a simpler unified approach to programming across very different platforms.

I urge you to become familiar with things like 'BBCodeview', 'smart strings', 'Wait For', 'B4Xpages', B4XOrderedMaps, and other state of the art B4X features.
I really believe you'll have fun expanding your horizons.
Thanks, but no. I'm not doing a lot of B4J lately, aside from donations sometimes. I prefer to stick with console apps, thanks anyway.

I've already decided, I'll do this in Groovy.
 
Upvote 0
Status
Not open for further replies.
Top