![]() PrintN("")Īll being well the output should appear in a console window looking something like this:įile List of C:\Documents And Settings\user\.Code: Select all Define i.i, rcWind.Rect, rcClient. Wait for the return key to be displayed, so the results can be viewed before the screen closes. See here what it would look like to produce a similar console application in B4X. The AmigaOS version is legacy and open-source. A simple input/output console-only program in QB64 would require only a few lines of code and will work in other variations of BASIC such as Liberty Basic, BBC with slight tweaks. Currently supported systems are Windows, Linux, macOS. Msg = Space(4) + Create + " " + Access + " " + Modify + " " + Attrib + " " + Size PureBasic is a native cross platform 32 bit and 64 bit BASIC compiler. Convert the attributes to a string, for now.Īttrib = RSet( StrU( Files()\Attributes), 6, " ") Convert the file size to a padded string the same as with the index value above, but allow space for the maximum size of a quad. Modify = FormatDate("%dd/%mm/%yyyy", Files()\DateModified) These lines convert the three date values to something more familiar.Ĭreate = FormatDate("%dd/%mm/%yyyy", Files()\DateCreated)Īccess = FormatDate("%dd/%mm/%yyyy", Files()\DateAccessed) Num = RSet( StrU( ListIndex( Files()) + 1), 3, " ") Here we use it to make sure all the index numbers are padded to 3 characters in length. RSet pads a string to a set length with the necessary number of a specified character at the front. When I resize a window I get a lot of PBEventSizeWindow events. StrU converts an unsigned number into a string. ListIndex() returns the current position in the list, counting from zero. saving and restoring column width of ListIcons possible. Save and restore Window size and position. ![]() proportional resizing of two or more gadgets. resizing of a selected ListIcon column possible. Loop through the list to display the results. Automatically resizing of gadgets if the window size changes. Msg = Space(4) + "Create" + Space(5) + "Access" + Space(5) + "Modify" + Space(5) + "Attrib Size" PrintN displays the string given in the console window and moves the print position to the start of the next line afterwards. Open a text mode screen to show the results. If there are some entries in the list, show the results in the debug window. Next, remove the output section of code completely, from the comment line: To verfiy that just open a window, make a screenshot of it and paste into Paint. Now we define a new list of files using the structure previously specified NewList Files.FILEITEM()ĭefine.s Access, Attrib, Create, Folder, Modify, Msg, Num, Size impractical size eh ButtonGadget(1,5,79,150,20,'Show/Hide extra window') in this example closing window 1 only hides window 1 closing window 2 both windows close - you can change to suit you situation. The values you get are the inner width / height of the window. So let's update our example to use it instead.įirst, we will need some extra working variables to make this work properly. PureBasic provides a text mode window, or console window, Give us much control over how our output looks. 2: - Use WMEXITSIZEMOVE to resize the grid. UserGuide - Displaying text output (Console) In the previous topic Input & Output you already saw an overview about the different possibilities to output text to the user, and in the topic Storing Data in Memory, we started to build a small application to display the properties of files in a particular folder to the debug window. Disable the ImageGadget () So you can resize the window only at any time. Create ImageGadget () with full dimensions + the grid image. PureBasic IDE which means its only useful to programmers, secondly it doesn't really To avoid resizing the grid flicker : 1 : - Create an image with the full dimension of your desktop. ![]() Firstly, this window is only available in the Now we're going to revisit this example to improve the data output section to resolve Topic Storing Data in Memory, we started to build a smallĪpplication to display the properties of files in a particular folder to the Wrong boolean expression evaluation (first reported in 2009). For years we had long standing bugs in the compiler, but recently Fred (the PureBasic creator by the way) has started to fix them. In the previous topic Input & Output you already sawĪn overview about the different possibilities to output text to the user, and in the Until version 6.0 in 2022, slow and spotty bug fixing has been the biggest let-down for me. UserGuide - Displaying text output (Console)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |