Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
row as text-proc
08-14-2012, 09:52 PM, (This post was last modified: 08-14-2012, 10:08 PM by RobertShiplett.)
#1
row as text-proc
While working on the Japanese-English dictionary interface at Jisho, I hit a puzzling bug whenI was told that I was assigning a text proc to a var, or assigning a value to a text proc ( compiler directive was stringent? .)

The answer? The identifier row is known globally as a text-proc name and my own local variable declared with the name 'row' for my current or selected data grid row number had slipped out of position within some upper and outer braces but with the variable referenced outside those braces.

That variable name quickly became 'ke-grid-row-num' !

I suspect that if you try {def row = you may hit the same compiler error, but {let row:int = had been fine as a local declaration in a procedure and set previous-row = row had also been fine ...

If you find an oddity like this using set row = 1, you may recall that text-proc.

Since the row text-proc is used for declarative tables and since that code already has a text-format named header-row, we might have done better using table-row, but row is already an accessor ...

Regardless, I did a refactoring pass improving all of my var names and it has made the code easier to read which will help in the major refactoring which is yet to occur for transitioning the dictionary to a double-character kanji-only version to complement the Tuttle flashcard sets.

The current Kanjidic2 and Edict2 dictionary interface is ready for beta test at the URL above.

Suggestions welcome, but BUG reports VERY welcome ! BETA-TESTERS Needed !!!

Robert Shiplett, Curlr
Fredericton NB

Canada
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Non-selectable characters amidst text RobertShiplett 1 5,065 09-09-2014, 03:16 AM
Last Post: RobertShiplett
  Curl as a markup DSL for Russian Text RobertShiplett 1 6,422 09-24-2012, 01:17 PM
Last Post: alton
  serialization for selections from a large off-line Japanese text resource RobertShiplett 0 2,943 06-04-2012, 11:20 PM
Last Post: RobertShiplett
  text-selectable? and DefaultDocument RobertShiplett 0 3,058 11-05-2011, 12:08 AM
Last Post: RobertShiplett
  Text Markup RobertShiplett 0 3,457 10-31-2011, 06:07 AM
Last Post: RobertShiplett
  Protected Text RobertShiplett 0 3,345 10-11-2011, 09:17 PM
Last Post: RobertShiplett
Forum Jump:


Users browsing this thread:
1 Guest(s)

MyBB SQL Error

MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
1017 - Can't find file: 'mybb_threadviews' (errno: 2)
Query:
INSERT INTO mybb_threadviews (tid) VALUES('595')