![]() Before it can compile a class or module, the IDE must convert everything in it down to lines of source code so it can send the compiler the equivalent of a plain text file. A Xojo project is a complex tree structure, but managing it is the IDE’s job - the compiler doesn’t know anything about it. The difference is that Functions return a value.īefore the compiler generates machine code for the processor to execute, the IDE has to generate source code for the compiler to parse. (unless you figure out the parameters yourself :))Īnd Subs and Functions are both Methods. If you just copy the part in between, it won’t work. It’s important because it holds the name, input parameters and return value. The first line is what you normally see in the Inspector (on the right side in the IDE). (p, 0, 0, newPic.width, newPic.height, 0, 0, p.width, p.height) Scales a Picture while keeping the correct aspect ratioĭim ratio As Double = min(maxHeight / p.height, maxWidth / p.width)ĭim newPic As New Picture(p.width * ratio, p.height * ratio) ![]() ![]() Here is a random function I copied with right click/copy: Function scaleImage(p as Picture, maxWidth as Integer, maxHeight as Integer) As Picture The first and last line don’t show in the editor itself but it’s part of the function. When I look at a file created by Make External, I see a text file of code. Is this correct?Īlso, when I read Marc Zeedar’s “Power User Tips” (XDev March/April 2015, pp58-64), he talks about putting hundreds of such routines (“Function … End Function” stuff, or “Sub … End Sub” stuff) in an “external module called MarcLibrary.” I assume he somehow reuses these routines in various projects. But it looks like these developers are dynamically creating Functions and Methods via code. I can see how I can use the IDE to, say, Insert Module, and then Add Method to that module, and then write the various parts of the Function or Method in the Method dialog box. I don’t see where they’re inserting such code in their Projects. All good.īut I keep reading articles on the Web and in XDev that refer to writing Functions and Methods with “Function … End Function”, and “Sub … End Sub”. It lets users log on and fill out a form of fields and press a button to have that emailed as a CSV file to someone else. Though I’m still very new to Xojo, I have a WebApp doing well now. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |