--- title: "Local Variables" type: "article" slug: "local-variables" url: "http://localhost/article/local-variables/" markdown_url: "http://localhost/article/local-variables.md" published_at: "2026-02-14T01:37:27+00:00" modified_at: "2026-02-14T01:37:28+00:00" featured_image: url: "http://localhost/wp-content/uploads/2022/04/20230809-041332.jpg" excerpt: "“What are local variables, anyway?\" This was one of the questions I asked myself when I first read my QL USER GUIDE. Of course, I didn’t know what a PROCedure was either. Soon I discovered that I had been using global variables all along and didn’t even know it. Local variables are used within a…" category: - name: "QL Report" slug: "ql-report" taxonomy: "category" url: "http://localhost/category/periodicals/ql-report/" post_tag: - name: "QL" slug: "ql" taxonomy: "post_tag" url: "http://localhost/tag/ql/" - name: "Type-in program" slug: "type-in-program" taxonomy: "post_tag" url: "http://localhost/tag/type-in-program/" model: - name: "Sinclair QL" slug: "sinclair-ql" taxonomy: "model" url: "http://localhost/model/sinclair-ql/" indiv: - name: "Marshall Stiles" slug: "marshall-stiles" taxonomy: "indiv" url: "http://localhost/indiv/marshall-stiles/" publication_r: id: 39073 title: "QL Report" type: "periodical" url: "http://localhost/periodical/ql-report/" authors_r: - name: "Marshall Stiles" slug: "marshall-stiles" taxonomy: "indiv" url: "http://localhost/indiv/marshall-stiles/" volume: "3" issue: "6" issues_articles: - id: 39088 title: "QL Report v3 n6" type: "issue" url: "http://localhost/issue/ql-report-v3-n6/" pages: "3-4" pubdate: "June 15, 1987" archive_link: false --- # Local Variables “What are local variables, anyway?” This was one of the questions I asked myself when I first read my QL USER GUIDE. Of course, I didn’t know what a PROCedure was either. Soon I discovered that I had been using global variables all along and didn’t even know it. Local variables are used within a procedure or a function without disrupting values assigned to variables with the same name outside the procedure or function. Generally speaking, in order for a variable to become local on the QL it must be declared thus by means of the LOCal command.