Author Topic: Putting text into fields  (Read 5336 times)

AtoZ

  • Newbie
  • *
  • Posts: 6
Putting text into fields
« on: February 27, 2012, 02:11:31 AM »
Hi, I'm new to HyperNext, although I did quite a bit of HyperCard development years ago.

I am having a fundamental problem trying to put text into a field. I have tried the following:

Put 123 into field 1

Local varNumbers
Put 123 into varNumbers
Put varNumbers into field 1

When I run the stack with either variation, nothing appears in field 1.

I'm clearly missing something obvious, but what?
Does this code need to be in a particular script? (At the moment it's in the Startup script.)
Does the field need to be activated somehow?

I've looked in all the documentation, I've looked through the forums, and so far everything that I see indicates that either of the two approches above should work.

Any suggestions?

P.S. Is it possible that my copy of HyperNext is corrupted? I first downloaded it yesterday, and mananged to cause a system crash in my first few minutes of trying to script (I had not yet noticed that some commands need their parameters inside parentheses and others do not (and I can testify that it makes a difference). Anyway, after a restart, I could not open any HyperNext stacks. I kept getting various error messages.

So I uninstalled HyperNext and then downloaded it again. When I tried to open the 2nd download, I got another error message saying some setup file was corrupted.  HyperNext was not yet showing in the Start/All Programs menu, meaning I couldin't run the uninstall option, so I just downloaded it a 3rd time over whatever was already there.

This time everything appeared to go OK, but I worry that perhaps there is still some corrupted Hypernext file from the 1st or 2nd download that might be interfering with things.


Malkom

  • Administrator
  • Newbie
  • *****
  • Posts: 434
  • Here to help you
Re: Putting text into fields
« Reply #1 on: February 27, 2012, 05:10:21 AM »
Hello AtoZ

Its always nice to see a Hypercard user/developer here :)

Just a quick reply to the field problems you are having:-

1) Is the field wide enough for the text? - it might need resizing

2) Is the field multi-line? By default fields are single line and this can prevent multi-line text showing up.
        To set to multi-line - use the Tool bar (Properties) it is on the Place tab

I hope this helps

Malkom
P.S
Just wondering which Operating System you are on Windows/Mac and version

I am sorry but I do not have time to answer questions by PM or email.
If you post your questions in this forum then it might help others.

Malkom

  • Administrator
  • Newbie
  • *****
  • Posts: 434
  • Here to help you
Re: Putting text into fields
« Reply #2 on: February 27, 2012, 06:56:45 AM »
Also, ensure the text color is different to the field color. By default they should be black and pale yellow respectively.
I am sorry but I do not have time to answer questions by PM or email.
If you post your questions in this forum then it might help others.

AtoZ

  • Newbie
  • *
  • Posts: 6
Re: Putting text into fields
« Reply #3 on: February 27, 2012, 08:19:12 AM »
Sorry, I should have mentioned in my first post that I'm usiing Windows XP.

I checked out the things you mentioned:

1. The field is much bigger than the text I'm trying to insert (which at this point is only 3 characters).

2. The field still has the default settings of black for text and yellow for background

3. The field was set for single line, which should have been OK for this text, but I changed the field property to mulitline.

Number 3 was the only change I made, and now when I run the program it crashes, giving me two consecutive error messages: "Sorry, an internal error has occurred: XR_GotoCard" followed by "Sorry, an internal error has occured: DragCanvas Update StretchedPic"

At the moment my stack consists of two cards. There is one field on card 1 and nothing on card 2.

Here is the entire code so far (locared in the StartUp section on the MainScript:


@ Any code here is exectuted before the Home card loads.

@ ---------------------------------------------------------------------------------------------------------------------------------

@Global variables:

Global varCardCount
Global varScreenWidth
Global varScreenHeight

@ Local variables:

Local x

@ ---------------------------------------------------------------------------------------------------------------------------------

@ Store number of cards, screen width and height::

Put TotalCardsFN into varCardCount
Put ScreenWidthFN into varScreenWidth
Put ScreenHeightFN into varScreenHeight

@ ---------------------------------------------------------------------------------------------------------------------------------

@ Set card sizes to fill screen

Put 1 into x

For x = 1 to varCardCount Step 1

   CardSetLeft(x,0)
   CardSetTop(x,2)

   CardSetWidth(x,varScreenWidth-100)
   CardSetHeight(x,varScreenHeight-100)

EndFor

@ ---------------------------------------------------------------------------------------------------------------------------------

@ TEMP Get Info

GotoCard 1

Put 123 into field 1

@ ---------------------------------------------------------------------------------------------------------------------------------



Thank for any help you can give me.

P.S. I'm still worried that my copy of HyperNext may be corrupted, but before I download it again, I would like to be sure that I delete EVERYTHING from the past installations. For example, are there files in some temp folder that your Uninstall program would not delete?

Malkom

  • Administrator
  • Newbie
  • *****
  • Posts: 434
  • Here to help you
Re: Putting text into fields
« Reply #4 on: February 27, 2012, 10:18:42 AM »
Thank you for all the details on this.

One thing that will cause a problem - there should not be any GotoCard commands in the Constants, Variables or Startup sections of MainCode because those sections have to be allowed to complete their initialisation.

Its just occurred to me that this limitation hasn't been mentioned before either in the forums or by email - and its not in the docs - so you weren't to know.

Also, as card 1 (Home card) hasn't loaded yet - its best to place text into its field from within Card 1.
So place your command Put 123 into field 1 into Card 1's open handler.

« Last Edit: February 27, 2012, 11:32:46 AM by Malkom »
I am sorry but I do not have time to answer questions by PM or email.
If you post your questions in this forum then it might help others.

AtoZ

  • Newbie
  • *
  • Posts: 6
Re: Putting text into fields
« Reply #5 on: February 27, 2012, 10:22:42 PM »
Thanks for your quick responses to this post.

I'm happy to report that your latest reply solved the problem.

I have a couple of suggestions that might help you reduce the number of questions you get in these forums:

1) You might want to create a read-only topic in the appropriate place in the forums where you could list undocumented features and errors in the documentation as they come to light. I remember seeing at least one other undocumented feature in another post. I suspect there are others yet to come to light. (A small example of a documentation error that I noticed the other day is in the HyperNext Language Reference entry for the GotoCard command: the examples shown in the description of the command use "Goto" rather than "GotoCard". The examples generate an error message if you use them in a script.)

2) I think it would also be useful to have another read-only topic where you would discuss how the HyperNext programming language differs from other similar programming languages such as HyperCard, Visual Basic, and Real Basic. I wouldn't expect it to be an exhaustive discussion, just a list of some of the primary differences and unique properties/limitations. I've seen you discuss this type of things in various posts, but it would be nice to sort of collect them in one place as you deal with user questions.

3) It would be enormously helpful if you could release an updated version of the HyperNext Language Reference where the Table of Contents entires are links to the topics discussed in the document. It would also help if you would change the properties of the pdf document to allow users to select and copy text.  I've seen both of these features implemented in other pdf documents.

That's it for now. Thanks again for your prompt help.

Malkom

  • Administrator
  • Newbie
  • *****
  • Posts: 434
  • Here to help you
Re: Putting text into fields
« Reply #6 on: February 28, 2012, 06:34:01 AM »
Thats nice to see they worked for you and you are making progress  :)


Thank you for the feature suggestions as they are all something that needs doing.

We added the bug list to our HyperNext Android forums but it does need adding here. I'll add the new section later today.


There is a small section on our website about HyperNext as compared to Visual Basic but it is very short and a longer list is needed:-

http://www.tigabyte.com/hnfiles/progvb.html


Yes, the docs need an update and that is on our to do list but it will come.

I am sorry but I do not have time to answer questions by PM or email.
If you post your questions in this forum then it might help others.

 

anything