Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 09:13 01 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Constants in an include file

Author Message
elk1984

Senior Member

Joined: 11/07/2020
Location: United Kingdom
Posts: 228
Posted: 11:04pm 12 Sep 2020
Copy link to clipboard 
Print this post

Hi,


Very newbie question (sorry!), but I can't find a way to keep my contants declared outside the main body of my code.

I've tried putting them in a SUB (not found as they're declared local) and in an include file (no effect).

Is this possible?


Thanks in advance for any help.
 
elk1984

Senior Member

Joined: 11/07/2020
Location: United Kingdom
Posts: 228
Posted: 12:08am 13 Sep 2020
Copy link to clipboard 
Print this post

  elk1984 said  Hi,


Very newbie question (sorry!), but I can't find a way to keep my contants declared outside the main body of my code.

I've tried putting them in a SUB (not found as they're declared local) and in an include file (no effect).

Is this possible?


Thanks in advance for any help.


Solved my own issue.  Two things I'd done wrong.

1. When trying to include my constants, I'd used

 #Include "Constants.lib"

Having two leading spaces meant the #Include directive was ignored.

2. When I removed the leading spaces, I got an error saying the file must be a .inc file

Renaming my .lib to .inc and the constants are working like a charm!  
 
mkopack73
Senior Member

Joined: 03/07/2020
Location: United States
Posts: 261
Posted: 01:53pm 13 Sep 2020
Copy link to clipboard 
Print this post

Interesting that the 2 leading spaces caused it not to work. Let Peter know. Might be something he can fix quickly (might not be, probably some annoying quirk of the parser...)
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10310
Posted: 01:58pm 13 Sep 2020
Copy link to clipboard 
Print this post

  Quote  Interesting that the 2 leading spaces caused it not to work. Let Peter know.

Fixed in V5.05.05
 
elk1984

Senior Member

Joined: 11/07/2020
Location: United Kingdom
Posts: 228
Posted: 02:52pm 13 Sep 2020
Copy link to clipboard 
Print this post

  matherp said  
  Quote  Interesting that the 2 leading spaces caused it not to work. Let Peter know.

Fixed in V5.05.05


Thanks - now I've got a long enough data cable, I'll flash the firmware tonight.  I'm liking the flexibility hooking the CMM2 up over serial is giving.  One keyboard and the ability to send files without spending £100 on a Wireless SD Card (although that would be cool)
 
Womble

Senior Member

Joined: 09/07/2020
Location: United Kingdom
Posts: 267
Posted: 07:26pm 18 Sep 2020
Copy link to clipboard 
Print this post

  elk1984 said  ... without spending £100 on a Wireless SD Card (although that would be cool)

Don't do it.  Wireless SD cards DO NOT WORK in the CMM2.

Someone has already tried, and failed.
 
elk1984

Senior Member

Joined: 11/07/2020
Location: United Kingdom
Posts: 228
Posted: 09:21am 19 Sep 2020
Copy link to clipboard 
Print this post

  Womble said  
  elk1984 said  ... without spending £100 on a Wireless SD Card (although that would be cool)

Don't do it.  Wireless SD cards DO NOT WORK in the CMM2.

Someone has already tried, and failed.


Thanks for the tip. That's £100 to spend on other gadgets. Like a video capture card  
Edited 2020-09-19 19:23 by elk1984
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025