Zen Cart Logo
Forums / General Questions / coding questions, programmer questions, where should they be asked?

coding questions, programmer questions, where should they be asked?

Views: 1,159

Results 1 to 5 of 5
12 Sep 2013, 3:29 AM
#1
tcarden avatar

tcarden

Zen Follower

Join Date:
Oct 2012
Posts:
282
Plugin Contributions:
0

coding questions, programmer questions, where should they be asked?

I've completed several mods and add-ons for my client and would like to be able to offer up as plugins eventually. If I have ZC code specific questions, programmer questions or troubleshooting questions etc. (all ZenCart related), is there a place on here I could ask them?

for example, right now i'd like to know where the global var $db gets instantiated?

or where does EOF come from? (not finding that on php.net)

stuff like that, i'd very much like know. or perhaps, if for some reason it's not appropriate to ask such questions at all let me know, thanks

12 Sep 2013, 4:06 AM
#2
gilby avatar

gilby

Totally Zenned

Join Date:
Aug 2005
Location:
Vic, Oz
Posts:
1,816
Plugin Contributions:
0

Re: coding questions, programmer questions, where should they be asked?

A quick use of the developers Toolkit finds $db instantiated here:
admin/includes/init_includes/init_database.php
and
includes/init_includes/init_database.php

I believe EOF is part of the language and is a logical value (usually defined as a negative int) Correct me if I am wrong?

12 Sep 2013, 6:51 AM
#3
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: coding questions, programmer questions, where should they be asked?

$db is instantiated by the core code. You should never touch it. Simply declare it as a global var from within whatever function you've written which requires it.

EOF is a fairly well-known acronym amongst programmers, although moreso for veterans who were exposed to mainframes in decades past.

In ZC, EOF, when mentioned in a comment at the end of a file, is simply there to tell you that this is indeed the intended End Of File (EOF). It was placed there in a couple files when some much older code was removed from those files so that people wouldn't start posting that stuff is missing or ask if they should put the old junk back in.
You'll see "bof" (beginning of file, or beginning of section) and "eof" (end of file or end of section) in some template comments also ... and if the meaning isn't obvious, it's to denote the beginning and ending of lines of code which belong together, such as when someone comes along and wants to move things around.
They're all simply cues to help explain intentions.

12 Sep 2013, 8:31 AM
#4
gilby avatar

gilby

Totally Zenned

Join Date:
Aug 2005
Location:
Vic, Oz
Posts:
1,816
Plugin Contributions:
0

Re: coding questions, programmer questions, where should they be asked?

I suspect it was more the EOF in the php code such as```
while (!$category_products->EOF) {

12 Sep 2013, 3:09 PM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: coding questions, programmer questions, where should they be asked?

Oh. Ya, that makes sense too.

Same meaning there also: EOF used as meaning of end-of-dataset, as in end-of-results-list-from-the-query-that-was-run. It's a boolean true/false which is set to true when the movenext() pushes the pointer to the end of the set of returned query data.